diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-17 08:29:48 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-17 08:29:48 +0000 |
commit | 856be770a66a4d928f13c9d2f401dc1092e5270e (patch) | |
tree | 62c6391260ae26ec9a383e72265a4ab3f6894373 /editors/vi.c | |
parent | 7f175ccbc38c0de2423a9554f8ee1663431845d9 (diff) | |
download | busybox-w32-856be770a66a4d928f13c9d2f401dc1092e5270e.tar.gz busybox-w32-856be770a66a4d928f13c9d2f401dc1092e5270e.tar.bz2 busybox-w32-856be770a66a4d928f13c9d2f401dc1092e5270e.zip |
assorted fixes for breakage found by randomconfig
Diffstat (limited to 'editors/vi.c')
-rw-r--r-- | editors/vi.c | 15 |
1 files changed, 9 insertions, 6 deletions
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 | |||
2420 | file_modified++; | 2420 | file_modified++; |
2421 | close(fd); | 2421 | close(fd); |
2422 | fi0: | 2422 | fi0: |
2423 | if (ENABLE_FEATURE_VI_READONLY && update_ro_status | 2423 | #if ENABLE_FEATURE_VI_READONLY |
2424 | && ((access(fn, W_OK) < 0) || | 2424 | if (update_ro_status |
2425 | /* root will always have access() | 2425 | && ((access(fn, W_OK) < 0) || |
2426 | * so we check fileperms too */ | 2426 | /* root will always have access() |
2427 | !(statbuf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))) | 2427 | * so we check fileperms too */ |
2428 | { | 2428 | !(statbuf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) |
2429 | ) | ||
2430 | ) { | ||
2429 | SET_READONLY_FILE(readonly_mode); | 2431 | SET_READONLY_FILE(readonly_mode); |
2430 | } | 2432 | } |
2433 | #endif | ||
2431 | return cnt; | 2434 | return cnt; |
2432 | } | 2435 | } |
2433 | 2436 | ||