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
parent
3eeedd7caf
commit
0905c6ae7e
|
@ -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
|
/* 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.
|
* "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. */
|
* obtained fd otherwise. *f is set to the opened file. */
|
||||||
int open_file(const char *filename, bool newfie, FILE **f)
|
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) {
|
if (newfie) {
|
||||||
statusbar(_("New File"));
|
statusbar(_("New File"));
|
||||||
free(full_filename);
|
free(full_filename);
|
||||||
return -2;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
statusline(ALERT, _("File \"%s\" not found"), filename);
|
statusline(ALERT, _("File \"%s\" not found"), filename);
|
||||||
|
|
Loading…
Reference in New Issue