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

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

Bug existed since commit dd429d9c from yesterday.
master
Benno Schulenberg 2020-02-10 15:57:40 +01:00
parent 3eeedd7caf
commit 0905c6ae7e
1 changed files with 2 additions and 2 deletions

View File

@ -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);