From 0905c6ae7eabeb2728f3f6d62161565c86a0378e Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 10 Feb 2020 15:57:40 +0100 Subject: [PATCH] files: be consistent in which code means "New File" This fixes https://savannah.gnu.org/bugs/?57782. Bug existed since commit dd429d9c from yesterday. --- src/files.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index 581e0587..b28fb037 100644 --- a/src/files.c +++ b/src/files.c @@ -895,7 +895,7 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable) /* Open the file with the given name. If the file does not exist, display * "New File" if newfie is TRUE, and say "File not found" otherwise. - * Return -2 if we say "New File", -1 if the file isn't opened, and the + * Return 0 if we say "New File", -1 if the file isn't opened, and the * obtained fd otherwise. *f is set to the opened file. */ int open_file(const char *filename, bool newfie, FILE **f) { @@ -913,7 +913,7 @@ int open_file(const char *filename, bool newfie, FILE **f) if (newfie) { statusbar(_("New File")); free(full_filename); - return -2; + return 0; } statusline(ALERT, _("File \"%s\" not found"), filename);