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".master
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. */
|
* for a nameless buffer). If needed, the name is modified to be unique. */
|
||||||
void emergency_save(const char *plainname)
|
void emergency_save(const char *plainname)
|
||||||
{
|
{
|
||||||
bool failed = TRUE;
|
bool saved = FALSE;
|
||||||
char *targetname;
|
char *targetname;
|
||||||
|
|
||||||
if (*plainname == '\0')
|
if (*plainname == '\0')
|
||||||
|
@ -322,9 +322,9 @@ void emergency_save(const char *plainname)
|
||||||
targetname = get_next_filename(plainname, ".save");
|
targetname = get_next_filename(plainname, ".save");
|
||||||
|
|
||||||
if (*targetname != '\0')
|
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);
|
fprintf(stderr, _("\nBuffer written to %s\n"), targetname);
|
||||||
else if (*targetname != '\0')
|
else if (*targetname != '\0')
|
||||||
fprintf(stderr, _("\nBuffer not written to %s: %s\n"),
|
fprintf(stderr, _("\nBuffer not written to %s: %s\n"),
|
||||||
|
|
Loading…
Reference in New Issue