aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-script.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli/cli-script.c')
-rw-r--r--gdb/cli/cli-script.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 64b4c2b..1757e4e 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -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);