aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-03-28 14:18:21 +0000
committerpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-03-28 14:18:21 +0000
commit273b6cddeef6524f0a101fb255145e0ee3baafba (patch)
treed7502788892ff78dcdc31d7c0610cad2b9850a20 /editors/vi.c
parent7d0d9926fc7d3eb93987e917ded099ae28ca94e7 (diff)
downloadbusybox-w32-273b6cddeef6524f0a101fb255145e0ee3baafba.tar.gz
busybox-w32-273b6cddeef6524f0a101fb255145e0ee3baafba.tar.bz2
busybox-w32-273b6cddeef6524f0a101fb255145e0ee3baafba.zip
fix behavior of ZZ, with respect to readonly mode(s). original
patch and report from Alexander Griesser. git-svn-id: svn://busybox.net/trunk/busybox@14679 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'editors/vi.c')
-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)