Commit a61a44146db63a72f7bf98b08e5d16b18ab209da

Stefan Sperling 2019-08-07T17:27:51

histedit_edit_list_retry(): eat newlines in responses

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/got/got.c b/got/got.c
index cf03484..71b71a0 100644
--- a/got/got.c
+++ b/got/got.c
@@ -4651,6 +4651,8 @@ histedit_edit_list_retry(struct got_histedit_list *histedit_cmds,
 		printf("%s: %s\n(c)ontinue editing, (r)estart editing, "
 		    "or (a)bort: ", getprogname(), prev_err->msg);
 		resp = getchar();
+		if (resp == '\n')
+			resp = getchar();
 		if (resp == 'c') {
 			histedit_free_list(histedit_cmds);
 			err = histedit_run_editor(histedit_cmds, path, commits,