mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
readfile(): readonly: Also check "not writable".
This commit is contained in:
parent
b8c27a83b3
commit
a8d1b5f721
@ -496,7 +496,8 @@ readfile (
|
||||
// Check readonly.
|
||||
file_readonly = false;
|
||||
if (!read_buffer && !read_stdin) {
|
||||
if (!newfile || readonlymode || !(os_getperm(fname) & 0222)) {
|
||||
if (!newfile || readonlymode || !(perm & 0222)
|
||||
|| !os_file_is_writable((char *)fname)) {
|
||||
file_readonly = true;
|
||||
}
|
||||
fd = os_open((char *)fname, O_RDONLY, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user