diff options
author | Stefan Hoffmann <stefan991@gmail.com> | 2014-03-16 15:01:22 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-03 10:30:03 -0300 |
commit | 071d28076f4ee057764359999cf2fabc75e99314 (patch) | |
tree | 7303724b94d7b70d60aeb2f370736ce2f6d4714f /src/ex_cmds.c | |
parent | 4a138137f78907703aa9215b45f46b8f37d84ae5 (diff) | |
download | rneovim-071d28076f4ee057764359999cf2fabc75e99314.tar.gz rneovim-071d28076f4ee057764359999cf2fabc75e99314.tar.bz2 rneovim-071d28076f4ee057764359999cf2fabc75e99314.zip |
move check_file_readonly() into /src/os/fs.c and rename it
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 3d177b86af..65c71cdcb2 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2496,15 +2496,11 @@ int not_writing(void) */ static int check_readonly(int *forceit, buf_T *buf) { - struct stat st; - /* Handle a file being readonly when the 'readonly' option is set or when - * the file exists and permissions are read-only. - * We will send 0777 to check_file_readonly(), as the "perm" variable is - * important for device checks but not here. */ + * the file exists and permissions are read-only. */ if (!*forceit && (buf->b_p_ro - || (mch_stat((char *)buf->b_ffname, &st) >= 0 - && check_file_readonly(buf->b_ffname, 0777)))) { + || (os_file_exists(buf->b_ffname) + && os_file_is_readonly((char *)buf->b_ffname)))) { if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL) { char_u buff[DIALOG_MSG_SIZE]; |