← Commit list

3147552a2

Grob Grobmann
Grob Grobmann
2022-08-02
SUCCESS Duration: 155s

Subject

vi: add 'ZQ' quitting command

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/vi.c+7 -1
@@ -4324,8 +4324,14 @@ static void do_cmd(int c)
goto dc_i; // start inserting
break;
case 'Z': // Z- if modified, {write}; exit
- // ZZ means to save file (if necessary), then exit
c1 = get_one_char();
+ // ZQ means to exit without saving
+ if (c1 == 'Q') {
+ editing=0;
+ optind = cmdline_filecnt;
+ break;
+ }
+ // ZZ means to save file (if necessary), then exit
if (c1 != 'Z') {
indicate_error();
break;