mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
os/fs.c: remove os_file_is_readonly()
os_file_is_readonly() in its current form is equivalent to !os_file_is_writable(). This does not appear to be a bug, because Vim's use of check_file_readonly() (which we changed to os_file_is_readonly()) is equivalent to !os_file_is_writable() in every case. os_file_is_readonly() also fails this test: returns false if the file is non-read, non-write A more useful form would define behavior under these cases: - path is executable (but not writable) - path is non-existent - path is directory But there is no reason for os_file_is_readonly() to exist, so remove it.
This commit is contained in:
@@ -2623,7 +2623,7 @@ buf_write (
|
||||
* Check if the file is really writable (when renaming the file to
|
||||
* make a backup we won't discover it later).
|
||||
*/
|
||||
file_readonly = os_file_is_readonly((char *)fname);
|
||||
file_readonly = !os_file_is_writable((char *)fname);
|
||||
|
||||
if (!forceit && file_readonly) {
|
||||
if (vim_strchr(p_cpo, CPO_FWRITE) != NULL) {
|
||||
|
Reference in New Issue
Block a user