From 856be770a66a4d928f13c9d2f401dc1092e5270e Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Fri, 17 Aug 2007 08:29:48 +0000 Subject: assorted fixes for breakage found by randomconfig --- editors/vi.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'editors') diff --git a/editors/vi.c b/editors/vi.c index 461cf9889..afbddc251 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -2420,14 +2420,17 @@ static int file_insert(const char * fn, char *p file_modified++; close(fd); fi0: - if (ENABLE_FEATURE_VI_READONLY && update_ro_status - && ((access(fn, W_OK) < 0) || - /* root will always have access() - * so we check fileperms too */ - !(statbuf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))) - { +#if ENABLE_FEATURE_VI_READONLY + if (update_ro_status + && ((access(fn, W_OK) < 0) || + /* root will always have access() + * so we check fileperms too */ + !(statbuf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) + ) + ) { SET_READONLY_FILE(readonly_mode); } +#endif return cnt; } -- cgit v1.2.3