Error out immediatly when using if command without args in command list
[deliverable/binutils-gdb.git] / gdb / cli / cli-script.c
index 64b4c2b94a2257f8b7420ffb9bf3df57f843fae9..1757e4e196638a0c3e7d83126f33df3948a91d29 100644 (file)
@@ -147,7 +147,8 @@ build_command_line (enum command_control_type type, const char *args)
 {
   struct command_line *cmd;
 
-  if (args == NULL && (type == if_control || type == while_control))
+  if ((args == NULL || *args == '\0')
+      && (type == if_control || type == while_control))
     error (_("if/while commands require arguments."));
   gdb_assert (args != NULL);
 
This page took 0.022851 seconds and 4 git commands to generate.