aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fox <pgf@brightstareng.com>2006-03-28 14:18:21 +0000
committerPaul Fox <pgf@brightstareng.com>2006-03-28 14:18:21 +0000
commitf0305b7f75714936f87a30cd9c113709a7328446 (patch)
treed7502788892ff78dcdc31d7c0610cad2b9850a20
parent6850017a2fd73c9e385e79e8af9b0be2da63eb51 (diff)
downloadbusybox-w32-f0305b7f75714936f87a30cd9c113709a7328446.tar.gz
busybox-w32-f0305b7f75714936f87a30cd9c113709a7328446.tar.bz2
busybox-w32-f0305b7f75714936f87a30cd9c113709a7328446.zip
fix behavior of ZZ, with respect to readonly mode(s). original
patch and report from Alexander Griesser.
-rw-r--r--editors/vi.c11
1 files changed, 6 insertions, 5 deletions
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:
3617 indicate_error(c); 3617 indicate_error(c);
3618 break; 3618 break;
3619 } 3619 }
3620 if (file_modified 3620 if (file_modified) {
3621#ifdef CONFIG_FEATURE_VI_READONLY 3621#ifdef CONFIG_FEATURE_VI_READONLY
3622 && ! vi_readonly 3622 if (vi_readonly || readonly) {
3623 && ! readonly 3623 psbs("\"%s\" File is read only", cfn);
3624#endif /* CONFIG_FEATURE_VI_READONLY */ 3624 break;
3625 ) { 3625 }
3626#endif /* CONFIG_FEATURE_VI_READONLY */
3626 cnt = file_write(cfn, text, end - 1); 3627 cnt = file_write(cfn, text, end - 1);
3627 if (cnt < 0) { 3628 if (cnt < 0) {
3628 if (cnt == -1) 3629 if (cnt == -1)