]> git.draconx.ca Git - cdecl99.git/blobdiff - src/execute.gperf
Improve cdecl99 error output.
[cdecl99.git] / src / execute.gperf
index e8a066547b73ff7e3cd85927ffeb04f50d8c7ae1..b1e7d5931ee2e4746c3c04bf80050cb1ab6583c6 100644 (file)
@@ -73,13 +73,13 @@ static int run_cmd_help(void)
                w = printf("  %s", stringpool+c->name);
                if (w < 0 || w > 13) {
                        putchar('\n');
-                        0;
+                       w = 0;
                }
 
                print_block(gettext(strtab+c->cmd), 15, w);
        }
 
-       return 1;
+       return 0;
 }
 
 int run_command(const char *line, int interactive)
@@ -90,12 +90,11 @@ 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) {
-               fprintf(stderr, _("unknown command %.*s\n"),
-                               (int)(arg-cmd), cmd);
+               print_error(_("unknown command %.*s"), (int)(arg-cmd), cmd);
                if (interactive) {
                        fprintf(stderr, "%s\n",
                                _("Try \"help\" for a list of possible commands."));