X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/23bee8f66fbd14c308d3c509a59024768bc2feef..feb48afbafaee0119c91204b21edf099f326578f:/src/commands.c diff --git a/src/commands.c b/src/commands.c index 429ba85..a80fe76 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1,6 +1,6 @@ /* * Main command implementation routines for cdecl99. - * Copyright © 2011-2012, 2020-2021, 2023 Nick Bowler + * Copyright © 2011-2012, 2020-2021, 2023-2024 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 @@ -88,7 +88,6 @@ int run_command_cdecl(const char *s, int input_mode, int output_mode) for (i = parse; i; i = i->next) { const char *str; - int no_nl = 0; if (!(str = do_render(i, output_mode))) goto out; @@ -99,10 +98,10 @@ int run_command_cdecl(const char *s, int input_mode, int output_mode) */ if (output_mode == OUTPUT_C && i->next) { i->next->specifiers = NULL; - no_nl = 1; + printf("%s, ", str); + } else { + puts(str); } - - printf(", %s%s" + 2*!!i->specifiers, str, "\n" + no_nl); } ret = 0;