ldlinux: Don't return previous command if user pressenter enter
authorMatt Fleming <matt.fleming@intel.com>
Fri, 25 Nov 2011 15:36:55 +0000 (15:36 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 2 Dec 2011 12:13:30 +0000 (12:13 +0000)
If the user presses enter at the command prompt then simply print the
command prompt again on a newline - don't re-execute the previous
command.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/elflink/ldlinux/cli.c

index 4749dda..3bb7db4 100644 (file)
@@ -451,7 +451,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
     strcpy(comm_counter->command, ret);
     list_add(&(comm_counter->list), &cli_history_head);
 
-    return ret;
+    return len ? ret : NULL;
 }
 
 static int cli_init(void)