summaryrefslogtreecommitdiffhomepage
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index d818127e2..a38f2189d 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3054,7 +3054,7 @@ static void colon(char *buf)
fn = args;
}
# if ENABLE_FEATURE_VI_READONLY
- else if (readonly_mode && !useforce) {
+ else if (readonly_mode && !useforce && fn) {
status_line_bold("'%s' is read only", fn);
goto ret;
}
@@ -3996,7 +3996,7 @@ static void do_cmd(int c)
break;
}
if (modified_count) {
- if (ENABLE_FEATURE_VI_READONLY && readonly_mode) {
+ if (ENABLE_FEATURE_VI_READONLY && readonly_mode && current_filename) {
status_line_bold("'%s' is read only", current_filename);
break;
}