Commit 592d0d6c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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 2823c99e.
No related merge requests found
Showing with 0 additions and 8 deletions
+0 -8
......@@ -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"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment