mirror of git://git.sv.gnu.org/nano.git
tweaks: rename a variable and flip its logic, to avoid two negations
Plus, it makes more sense to start in the state "not saved" than in the state "failed".
This commit is contained in:
parent
d0cb64650b
commit
30aaea2d04
|
@ -313,7 +313,7 @@ void do_exit(void)
|
|||
* for a nameless buffer). If needed, the name is modified to be unique. */
|
||||
void emergency_save(const char *plainname)
|
||||
{
|
||||
bool failed = TRUE;
|
||||
bool saved = FALSE;
|
||||
char *targetname;
|
||||
|
||||
if (*plainname == '\0')
|
||||
|
@ -322,9 +322,9 @@ void emergency_save(const char *plainname)
|
|||
targetname = get_next_filename(plainname, ".save");
|
||||
|
||||
if (*targetname != '\0')
|
||||
failed = !write_file(targetname, NULL, TRUE, OVERWRITE, FALSE);
|
||||
saved = write_file(targetname, NULL, TRUE, OVERWRITE, FALSE);
|
||||
|
||||
if (!failed)
|
||||
if (saved)
|
||||
fprintf(stderr, _("\nBuffer written to %s\n"), targetname);
|
||||
else if (*targetname != '\0')
|
||||
fprintf(stderr, _("\nBuffer not written to %s: %s\n"),
|
||||
|
|
Loading…
Reference in New Issue