aboutsummaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorStefan Hoffmann <stefan991@gmail.com>2014-03-16 15:01:22 +0100
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-03 10:30:03 -0300
commit071d28076f4ee057764359999cf2fabc75e99314 (patch)
tree7303724b94d7b70d60aeb2f370736ce2f6d4714f /src/ex_cmds.c
parent4a138137f78907703aa9215b45f46b8f37d84ae5 (diff)
downloadrneovim-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.c10
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];