commit 592d0d6c9a5175c62aa12d4a4c6d4f260fcab490
parent 3cc561e36e1be7f9199861dfad43bc6f576cb7d0
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sat, 26 Nov 2016 16:55:06 +0100
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.
Diffstat:
1 file changed, 0 insertions(+), 8 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -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"));