Moved history adding after checking for NULL

This commit is contained in:
jpk 2017-11-19 19:18:50 +01:00
parent e57c3a3ed6
commit af0e16e1d3
1 changed files with 2 additions and 1 deletions

View File

@ -168,11 +168,12 @@ void cmd_loop() {
do {
cmd = readline("> ");
add_history(cmd);
if (cmd == NULL)
break;
add_history(cmd);
cmd_start = pos = cmd;
while (*pos != '\0') {
// convert \n to separate argument