Rémi Bernon : widl: Strip last separator in append_namespaces if suffix is NULL.
Module: wine Branch: master Commit: 5f6fdb183880a60ce06e2488329c5493dcb5997c URL: https://source.winehq.org/git/wine.git/?a=commit;h=5f6fdb183880a60ce06e24883... Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Feb 26 09:43:05 2021 +0100 widl: Strip last separator in append_namespaces if suffix is NULL. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/typetree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index 6522e09dacf..9220cfb50e9 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -124,7 +124,12 @@ static size_t append_namespaces(char **buf, size_t *len, size_t pos, struct name size_t n = 0; n += strappend(buf, len, pos + n, "%s", prefix); if (nested) n += append_namespace(buf, len, pos + n, namespace, separator, abi_prefix); - n += strappend(buf, len, pos + n, "%s", suffix); + if (suffix) n += strappend(buf, len, pos + n, "%s", suffix); + else if (nested) + { + n -= strlen(separator); + (*buf)[n] = 0; + } return n; }
participants (1)
-
Alexandre Julliard