[PATCH 3/4] widl: Strip last separator in append_namespaces if suffix is NULL.

Rémi Bernon rbernon at codeweavers.com
Fri Feb 26 02:43:05 CST 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 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;
 }
 
-- 
2.30.0




More information about the wine-devel mailing list