Rémi Bernon : widl: Strip last separator in append_namespaces if suffix is NULL.
Alexandre Julliard
julliard at winehq.org
Fri Feb 26 14:39:29 CST 2021
Module: wine
Branch: master
Commit: 5f6fdb183880a60ce06e2488329c5493dcb5997c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5f6fdb183880a60ce06e2488329c5493dcb5997c
Author: Rémi Bernon <rbernon at 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 at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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;
}
More information about the wine-cvs
mailing list