1
1

files: save the marked region only when we've prompted for a file name

Otherwise we would overwrite the current file with just the selection.

This fixes https://savannah.gnu.org/bugs/?52482.
Этот коммит содержится в:
Benno Schulenberg 2017-11-22 20:56:37 +01:00
родитель 7c3c942097
Коммит cf63a2910a

Просмотреть файл

@ -2242,7 +2242,7 @@ int do_writeout(bool exiting, bool withprompt)
* function is disabled, since it allows reading from or * function is disabled, since it allows reading from or
* writing to files not specified on the command line. */ * writing to files not specified on the command line. */
#ifndef NANO_TINY #ifndef NANO_TINY
if (openfile->mark && !exiting && !ISSET(RESTRICTED)) if (openfile->mark && !exiting && withprompt && !ISSET(RESTRICTED))
result = write_marked_file(answer, NULL, FALSE, method); result = write_marked_file(answer, NULL, FALSE, method);
else else
#endif #endif