Paul Vriens : fusion/tests: Don't crash if we have a culture attribute.

Alexandre Julliard julliard at winehq.org
Fri Feb 20 12:49:35 CST 2009


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Fri Feb 20 08:37:31 2009 +0100

fusion/tests: Don't crash if we have a culture attribute.

---

 dlls/fusion/tests/asmenum.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/fusion/tests/asmenum.c b/dlls/fusion/tests/asmenum.c
index f3be262..cbc0c40 100644
--- a/dlls/fusion/tests/asmenum.c
+++ b/dlls/fusion/tests/asmenum.c
@@ -244,11 +244,24 @@ static BOOL enum_gac_assemblies(struct list *assemblies, int depth, LPSTR path)
         }
         else if (depth == 1)
         {
-            ptr = strstr(ffd.cFileName, "__");
+            char culture[MAX_PATH];
+
+            ptr = strstr(ffd.cFileName, "_");
             *ptr = '\0';
-            ptr += 2;
-            sprintf(buf, "Version=%s, Culture=neutral, PublicKeyToken=%s",
-                    ffd.cFileName, ptr);
+            ptr++;
+
+            if (*ptr != '_')
+            {
+                lstrcpyA(culture, ptr);
+                *strstr(culture, "_") = '\0';
+            }
+            else
+                lstrcpyA(culture, "neutral");
+
+            ptr = strchr(ptr, '_');
+            ptr++;
+            sprintf(buf, "Version=%s, Culture=%s, PublicKeyToken=%s",
+                    ffd.cFileName, culture, ptr);
             lstrcpyA(disp, parent);
             lstrcatA(disp, buf);
 




More information about the wine-cvs mailing list