Eric Pouech : mscvrt: Fix some undname quirks ( space at the end of multi-level templates).

Alexandre Julliard julliard at winehq.org
Wed Nov 18 09:40:41 CST 2009


Module: wine
Branch: master
Commit: d568c2ac5612d204184cfe3099964ef4e07b48c6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d568c2ac5612d204184cfe3099964ef4e07b48c6

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Tue Nov 17 21:43:13 2009 +0100

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 3b98423..106ef73 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -1033,7 +1033,7 @@ static void test_demangle(void)
 /* 112 */ {"?f at T@@QAEHQAY2BE at BO@CI at D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"},
 /* 113 */ {"?f at T@@QAEHQAY1BE at BO@$$CBD at Z", "public: int __thiscall T::f(char const (* const)[20][30])"},
 /* 114 */ {"??0?$Foo at U?$vector_c at H$00$01$0?1$0A@$0A@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@@mpl at boost@@@@QAE at XZ",
-           "public: __thiscall Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647>>::Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647>>(void)"},
+           "public: __thiscall Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647> >::Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647> >(void)"},
 
     };
     int i, num_test = (sizeof(test)/sizeof(test[0]));
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index cb07905..670873d 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




More information about the wine-cvs mailing list