files: trying to open a non-existent file will never succeed
If it would, the returned file descriptor would make nano crash,
because the corresponding stream has not been opened. And when
returning zero instead (as the code did originally), nano would
open an empty buffer, although it claims to be reading the file.
In short: I think this is a leftover of an attempted fix of
https://savannah.gnu.org/bugs/?25297, from commit 2823c99
.
master
parent
3cc561e36e
commit
592d0d6c9a
|
@ -975,14 +975,6 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
|
|||
/* All cases below return. */
|
||||
free(full_filename);
|
||||
|
||||
/* Well, maybe we can open the file even if the OS says it's
|
||||
* not there. */
|
||||
if ((fd = open(filename, O_RDONLY)) != -1) {
|
||||
if (!quiet)
|
||||
statusbar(_("Reading File"));
|
||||
return fd;
|
||||
}
|
||||
|
||||
if (newfie) {
|
||||
if (!quiet)
|
||||
statusbar(_("New File"));
|
||||
|
|
Loading…
Reference in New Issue