Moved history adding after checking for NULL
This commit is contained in:
parent
e57c3a3ed6
commit
af0e16e1d3
|
@ -168,11 +168,12 @@ void cmd_loop() {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
cmd = readline("> ");
|
cmd = readline("> ");
|
||||||
add_history(cmd);
|
|
||||||
|
|
||||||
if (cmd == NULL)
|
if (cmd == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
add_history(cmd);
|
||||||
|
|
||||||
cmd_start = pos = cmd;
|
cmd_start = pos = cmd;
|
||||||
while (*pos != '\0') {
|
while (*pos != '\0') {
|
||||||
// convert \n to separate argument
|
// convert \n to separate argument
|
||||||
|
|
Loading…
Reference in New Issue