From e0157f424b775a4e37f6c03d713dfa6d97066428 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Fri, 20 Feb 2009 08:37:31 +0100 Subject: [PATCH] fusion/tests: Don't crash if we have a culture attribute. --- dlls/fusion/tests/asmenum.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/fusion/tests/asmenum.c b/dlls/fusion/tests/asmenum.c index f3be262867d..cbc0c40fbb3 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);