files: clear original filename when the user toggles Append or Prepend
When the current filename is equal to the filename of the buffer, then clear the filename, because the chances that the user wants to append or prepend a file to itself are practically nil. This fulfills https://savannah.gnu.org/bugs/?61243.master
parent
64c9d3c143
commit
bc22b3c876
|
@ -2194,9 +2194,13 @@ int do_writeout(bool exiting, bool withprompt)
|
||||||
TOGGLE(MAKE_BACKUP);
|
TOGGLE(MAKE_BACKUP);
|
||||||
continue;
|
continue;
|
||||||
} else if (func == prepend_void) {
|
} else if (func == prepend_void) {
|
||||||
|
if (strcmp(answer, openfile->filename) == 0)
|
||||||
|
given[0] = '\0';
|
||||||
method = (method == PREPEND) ? OVERWRITE : PREPEND;
|
method = (method == PREPEND) ? OVERWRITE : PREPEND;
|
||||||
continue;
|
continue;
|
||||||
} else if (func == append_void) {
|
} else if (func == append_void) {
|
||||||
|
if (strcmp(answer, openfile->filename) == 0)
|
||||||
|
given[0] = '\0';
|
||||||
method = (method == APPEND) ? OVERWRITE : APPEND;
|
method = (method == APPEND) ? OVERWRITE : APPEND;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue