Browse Source

vi: allow writing to another file if this one is readonly

Version 2. Same change but rebased after Ron's improvements. Fixes bug
where if you open a read only file, you can't save it as a different
filename.

function                                             old     new   delta
colon                                               3160    3162      +2

Signed-off-by: Alison Winters <alisonatwork@outlook.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Alison Winters 3 years ago
parent
commit
7b5cbfd6d6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editors/vi.c

+ 1 - 1
editors/vi.c

@@ -2938,7 +2938,7 @@ static void colon(char *buf)
 			fn = args;
 		}
 # if ENABLE_FEATURE_VI_READONLY
-		if (readonly_mode && !useforce) {
+		else if (readonly_mode && !useforce) {
 			status_line_bold("'%s' is read only", fn);
 			goto ret;
 		}