]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
common: cli_simple: don't repeat commands after <CTRL-C> from user
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 8 Mar 2017 14:58:06 +0000 (15:58 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 13 Mar 2017 15:36:25 +0000 (16:36 +0100)
Prevent the last command from being repeated (by entering an empty
line) when the command was aborted by <CTRL-C>

common/cli_simple.c

index bb96aaead60452b87cf44979b9dc586630855cf7..40e0beb217ce4de07008738835ce6ae0ba56ae3d 100644 (file)
@@ -294,11 +294,12 @@ void cli_simple_loop(void)
                }
 #endif
 
-               if (len == -1)
+               if (len == -1) {
                        puts("<INTERRUPT>\n");
-               else
+                       rc = 0;
+               } else {
                        rc = run_command_repeatable(lastcommand, flag);
-
+               }
                if (rc <= 0) {
                        /* invalid command or not repeatable, forget it */
                        lastcommand[0] = 0;