Going back to the filename prompt when the user decides to save a

changed buffer after all, as the buffer may not have a name yet.
This fixes Savannah bug #46752.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5512 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-12-23 19:18:33 +00:00
parent 31e1af646c
commit 480b6a320f
2 changed files with 5 additions and 3 deletions

View File

@ -7,6 +7,9 @@
* doc/man/nanorc.5: Improve ordering of bindable functions. * doc/man/nanorc.5: Improve ordering of bindable functions.
* src/files.c (read_file): Don't open an extra blank buffer when * src/files.c (read_file): Don't open an extra blank buffer when
an empty file is read. Bug was exposed by r5498, December 18. an empty file is read. Bug was exposed by r5498, December 18.
* src/files.c (do_writeout): When the user decides to save the
buffer after all, go back to the filename prompt because the
buffer may not have a name yet. This fixes Savannah bug #46752.
2015-12-23 Mike Frysinger <vapier@gentoo.org> 2015-12-23 Mike Frysinger <vapier@gentoo.org>
* doc/syntax/autoconf.nanorc: Handle .m4 files too, add the "elif" * doc/syntax/autoconf.nanorc: Handle .m4 files too, add the "elif"

View File

@ -2297,9 +2297,8 @@ int do_writeout(bool exiting)
if (i == 0) { if (i == 0) {
free(ans); free(ans);
return 2; /* Yes, discard the buffer. */ return 2; /* Yes, discard the buffer. */
} } else
if (i < 0) continue; /* Go back to the filename prompt. */
continue; /* The discard was cancelled. */
} }
ans = mallocstrcpy(ans, answer); ans = mallocstrcpy(ans, answer);