X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/f0c1e306132c731c95969b6ef653101702d0678f..4ce4dd35946ea92c7f50aaaf4cc370ef6042eaf0:/src/commands.c diff --git a/src/commands.c b/src/commands.c index 29184d5..fd2a5a3 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1,6 +1,6 @@ /* * Main command implementation routines for cdecl99. - * Copyright © 2011-2012, 2020-2021 Nick Bowler + * Copyright © 2011-2012, 2020-2021, 2023 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -66,8 +66,7 @@ int run_command_explain(const char *arg) decl = cdecl_parse_decl(arg); if (!decl) { - err = cdecl_get_error(); - print_error("%s", err->str); + print_error("%s", cdecl_get_error()->str); goto out; } @@ -94,8 +93,7 @@ int run_command_simplify(const char *arg) decl = cdecl_parse_decl(arg); if (!decl) { - err = cdecl_get_error(); - fprintf(stderr, "%s\n", err->str); + print_error("%s", cdecl_get_error()->str); goto out; } @@ -126,7 +124,6 @@ out: int run_command_declare(const char *cmd) { - const struct cdecl_error *err; struct cdecl *decl; const char *str; int ret = -1; @@ -134,8 +131,7 @@ int run_command_declare(const char *cmd) /* The name of the command is significant here. */ decl = cdecl_parse_english(cmd); if (!decl) { - err = cdecl_get_error(); - fprintf(stderr, "%s\n", err->str); + print_error("%s", cdecl_get_error()->str); goto out; }