mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
move check_file_readonly() into /src/os/fs.c and rename it
This commit is contained in:

committed by
Thiago de Arruda

parent
4a138137f7
commit
071d28076f
@@ -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];
|
||||
|
||||
|
Reference in New Issue
Block a user