From 5f6fdb183880a60ce06e2488329c5493dcb5997c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 26 Feb 2021 09:43:05 +0100 Subject: [PATCH] widl: Strip last separator in append_namespaces if suffix is NULL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- 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; }