locking: when finding a lock file at startup, quit when user cancels

When at startup the user presses Cancel at the "open anyway?" prompt,
cancel the whole startup: quit.  But when the user answers No, just
skip the file and continue starting up.
This commit is contained in:
Benno Schulenberg
2020-02-02 12:54:34 +01:00
parent 88087f2b2f
commit 7ce1f6d86d
4 changed files with 10 additions and 0 deletions

View File

@@ -335,6 +335,10 @@ int do_lockfile(const char *filename, bool ask_the_user)
choice = do_yesno_prompt(FALSE, promptstr);
free(promptstr);
/* When the user cancelled while we're still starting up, quit. */
if (choice < 0 && !we_are_running)
finish();
if (choice < 1) {
retval = -1;
wipe_statusbar();