From d568c2ac5612d204184cfe3099964ef4e07b48c6 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 17 Nov 2009 21:43:13 +0100 Subject: [PATCH] mscvrt: Fix some undname quirks (space at the end of multi-level templates). --- dlls/msvcrt/tests/cpp.c | 2 +- dlls/msvcrt/undname.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 3b98423b6e1..106ef73ce27 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -1033,7 +1033,7 @@ static void test_demangle(void) /* 112 */ {"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"}, /* 113 */ {"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"}, /* 114 */ {"??0?$Foo@U?$vector_c@H$00$01$0?1$0A@$0A@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@@mpl@boost@@@@QAE@XZ", - "public: __thiscall Foo>::Foo>(void)"}, + "public: __thiscall Foo >::Foo >(void)"}, }; int i, num_test = (sizeof(test)/sizeof(test[0])); diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index cb079050bda..670873d586d 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -367,6 +367,7 @@ static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_t struct datatype_t ct; struct array arg_collect; char* args_str = NULL; + char* last; unsigned int i; str_array_init(&arg_collect); @@ -402,7 +403,8 @@ static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_t args_str = str_printf(sym, "%s,%s", args_str, arg_collect.elts[i]); } - if (close_char == '>' && args_str && args_str[strlen(args_str) - 1] == '>') + last = args_str ? args_str : arg_collect.elts[0]; + if (close_char == '>' && last[strlen(last) - 1] == '>') args_str = str_printf(sym, "%c%s%s %c", open_char, arg_collect.elts[0], args_str, close_char); else