]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Fix output regression with multiple declarators.
authorNick Bowler <nbowler@draconx.ca>
Fri, 28 Jul 2023 04:22:11 +0000 (00:22 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 28 Jul 2023 04:22:11 +0000 (00:22 -0400)
commitd5c6a2e654422894c528cda52e951739a6b66ae6
tree66aafff220ee0042a530a0a31e03c1c14a974b0f
parent8d1fb21fe111eba2b54579d5115017f40d0d949c
libcdecl: Fix output regression with multiple declarators.

It turns out that the cdecl99 program implemented the simplify command
using the undocumented behaviour of calling cdecl_declare with NULL
specifiers to output just the declarator part.

Recent changes to the library partially broke that usage by printing an
extra space in this case.  This went unnoticed as the simplify command
is only lightly tested and nothing checks its behaviour with multiple
declarators.

Fortunately it is very easy to restore the old behaviour in the library,
and to add a test case to verify this behaviour.
src/declare.c
tests/decl-good.at