Returning a fantastic file descriptor -- when opening

a non-existent file for reading succeeds.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5565 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2016-01-15 14:23:50 +00:00
parent dfeb0f938f
commit caa759be31
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2016-01-15 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (set_modified): Plug another memory leak.
* src/files.c (open_file): Return the fantastic file descriptor
when opening a non-existent file for reading succeeds.
2016-01-15 Mike Frysinger <vapier@gentoo.org>
* src/files.c (open_file): Free the full filename in all cases.

View File

@ -933,7 +933,7 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
if ((fd = open(filename, O_RDONLY)) != -1) {
if (!quiet)
statusbar(_("Reading File"));
return 0;
return fd;
}
if (newfie) {