tweaks: reshuffle a condition, to make a little more sense

master
Benno Schulenberg 2020-05-11 19:40:17 +02:00
parent 2dd97a0352
commit b18f1265ff
1 changed files with 2 additions and 2 deletions

View File

@ -751,8 +751,8 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable)
fclose(f);
if (fd > 0 && !undoable)
writable = (ISSET(VIEW_MODE) || access(filename, W_OK) == 0);
if (fd > 0 && !undoable && !ISSET(VIEW_MODE))
writable = (access(filename, W_OK) == 0);
/* If the file ended with newline, or it was entirely empty, make the
* last line blank. Otherwise, put the last read data in. */