From b18f1265ff451a888a5ae585964b451107c4aab2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 11 May 2020 19:40:17 +0200 Subject: [PATCH] tweaks: reshuffle a condition, to make a little more sense --- src/files.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index a392ba67..8f3b7983 100644 --- a/src/files.c +++ b/src/files.c @@ -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. */