nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 0905c6ae7eabeb2728f3f6d62161565c86a0378e
parent 3eeedd7caf9304fa39ebad128633a7cfdc980c5a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 10 Feb 2020 15:57:40 +0100

files: be consistent in which code means "New File"

This fixes https://savannah.gnu.org/bugs/?57782.

Bug existed since commit dd429d9c from yesterday.

Diffstat:
Msrc/files.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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);