print_block(gettext(strtab+c->cmd), 15, w);
}
- return 1;
+ return 0;
}
int run_command(const char *line, int interactive)
/* empty command */
if (cmd[0] == '\0')
- return 1;
+ return 0;
c = in_word_set(cmd, arg-cmd);
if (!c) {
AT_CHECK([sed '/^cdecl_/d' stdout])
AT_CLEANUP
+
+dnl Verify that empty commands do nothing.
+AT_SETUP([cdecl99 empty command])
+
+AT_DATA([input], [[explain int x[42];
+
+declare x as array 42 of int
+
+explain int
+
+]])
+
+AT_CHECK([cdecl99 -f input], [0], [[declare x as array 42 of int
+int x[42]
+type int
+]])
+
+AT_CLEANUP
+
+dnl Verify that commands are not executed after "quit"
+AT_SETUP([cdecl99 quit command])
+
+AT_DATA([input], [[explain int;
+quit
+explain this is a syntax error
+]])
+
+AT_CHECK([cdecl99 -f input], [0], [type int
+])
+
+AT_CLEANUP
+
+AT_SETUP([cdecl99 help command])
+
+AT_DATA([input], [[help
+explain int
+]])
+
+AT_CHECK([cdecl99 -f input], [0], [stdout])
+AT_CHECK([sed -n '$p' stdout], [0], [type int
+])
+
+AT_CLEANUP