diff --git a/vi.c b/vi.c index 1d7f9ac..99f839a 100644 --- a/vi.c +++ b/vi.c @@ -3942,11 +3942,11 @@ static void do_cmd(char c) case 'Z': // Z- if modified, {write}; exit // ZZ means to save file (if necessary), then exit c1 = get_one_char(); - if (c1 != 'Z') { + if (c1 != 'Z' && c1 != 'Q') { indicate_error(c); break; } - if (file_modified) { + if (file_modified && c1 != 'Q') { if (ENABLE_FEATURE_VI_READONLY && readonly_mode) { status_line_bold("\"%s\" File is read only", current_filename); break;