From: Paul Fox Date: Tue, 28 Mar 2006 14:18:21 +0000 (-0000) Subject: fix behavior of ZZ, with respect to readonly mode(s). original X-Git-Tag: 1_1_0~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f0305b7f75714936f87a30cd9c113709a7328446;p=oweals%2Fbusybox.git fix behavior of ZZ, with respect to readonly mode(s). original patch and report from Alexander Griesser. --- diff --git a/editors/vi.c b/editors/vi.c index 1cd1b1ae9..2852b384a 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -3617,12 +3617,13 @@ key_cmd_mode: indicate_error(c); break; } - if (file_modified + if (file_modified) { #ifdef CONFIG_FEATURE_VI_READONLY - && ! vi_readonly - && ! readonly -#endif /* CONFIG_FEATURE_VI_READONLY */ - ) { + if (vi_readonly || readonly) { + psbs("\"%s\" File is read only", cfn); + break; + } +#endif /* CONFIG_FEATURE_VI_READONLY */ cnt = file_write(cfn, text, end - 1); if (cnt < 0) { if (cnt == -1)