mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 22:29:42 +03:00
shutdown: ignore a modified buffer when in view mode
In view mode it should be impossible to modify any buffer, but... when (through some bug) the user did succeed in modifying a buffer, this should not lead to writing out this modified buffer to disk. Had this safety stop been present earlier, it would have prevented the second part of https://savannah.gnu.org/bugs/?63616.
This commit is contained in:
parent
078d612b9e
commit
0662fc4d42
@ -303,7 +303,7 @@ void do_exit(void)
|
||||
|
||||
/* When unmodified, simply close. Else, when doing automatic saving
|
||||
* and the file has a name, simply save. Otherwise, ask the user. */
|
||||
if (!openfile->modified)
|
||||
if (!openfile->modified || ISSET(VIEW_MODE))
|
||||
choice = NO;
|
||||
else if (ISSET(SAVE_ON_EXIT) && openfile->filename[0] != '\0')
|
||||
choice = YES;
|
||||
|
Loading…
Reference in New Issue
Block a user