rebase: consolidate clean-up code before leaving reset_head()
[gitweb.git] / sequencer.c
index 73efa92da837c895980ce2d101c190218b6a7204..9e1ab3a2a7e3f65cc444cded7f3330bb27be2db8 100644 (file)
@@ -1994,7 +1994,8 @@ static int parse_insn_line(struct todo_item *item, const char *bol, char *eol)
                if (skip_prefix(bol, todo_command_info[i].str, &bol)) {
                        item->command = i;
                        break;
-               } else if (bol[1] == ' ' && *bol == todo_command_info[i].c) {
+               } else if ((bol + 1 == eol || bol[1] == ' ') &&
+                          *bol == todo_command_info[i].c) {
                        bol++;
                        item->command = i;
                        break;