commit 426ebf2e17bcc7dd65efb6db32f200729b1f57c4 from: Stefan Sperling date: Thu Jul 25 12:54:35 2019 UTC fix histedit's interactive retry loop commit - b006047e8a8af017974aa8fd9759431b3dbaad12 commit + 426ebf2e17bcc7dd65efb6db32f200729b1f57c4 blob - 7486c8d8449c19acbcdb06d976a6dbec5a1e8025 blob + cb742545ed221b63c6fe77744b828547386da0ad --- got/got.c +++ got/got.c @@ -4502,21 +4502,28 @@ histedit_edit_list_retry(struct got_histedit_list *his printf("%s: %s\n(c)ontinue editing, (r)estart editing, " "or (a)bort: ", getprogname(), errmsg); resp = getchar(); - switch (resp) { - case 'c': + if (resp == 'c') { err = histedit_run_editor(histedit_cmds, path, repo); - break; - case 'r': + if (err) { + if (err->code != GOT_ERR_HISTEDIT_SYNTAX) + break; + resp = ' '; + continue; + } + } else if (resp == 'r') { err = histedit_edit_script(histedit_cmds, commits, repo); - break; - case 'a': + if (err) { + if (err->code != GOT_ERR_HISTEDIT_SYNTAX) + break; + resp = ' '; + continue; + } + } else if (resp == 'a') { err = got_error(GOT_ERR_HISTEDIT_CANCEL); break; - default: + } else printf("invalid response '%c'\n", resp); - break; - } } return err;