From 8ee185f04ef85e7d1406f6c73d04f2a01658c2ca Mon Sep 17 00:00:00 2001 From: stanton Date: Tue, 2 Feb 1999 22:32:17 +0000 Subject: * win/winDumpExts.c: Patched to be picker about stripping @'s. [Bug: 920] --- win/winDumpExts.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/win/winDumpExts.c b/win/winDumpExts.c index 96b7067..80f7c87 100644 --- a/win/winDumpExts.c +++ b/win/winDumpExts.c @@ -19,7 +19,7 @@ * compiler other than Visual C++. *---------------------------------------------------------------------- * - * RCS: @(#) $Id: winDumpExts.c,v 1.2 1998/09/14 18:40:21 stanton Exp $ + * RCS: @(#) $Id: winDumpExts.c,v 1.3 1999/02/02 22:32:17 stanton Exp $ */ #include @@ -236,8 +236,14 @@ DumpExternals(PIMAGE_SYMBOL pSymbolTable, FILE *fout, unsigned cSymbols) strcpy(symbol, s); } s = symbol; - f = strchr(s, '@'); - if (f) { + + /* + * Skip to the last @ and ensure it is followed by digits, + * otherwise it is probably part of a C++ mangled name. + */ + + f = strrchr(s, '@'); + if (f && f[1] >= '0' && f[1] <= '9') { *f = 0; } #if defined(_MSC_VER) && defined(_X86_) @@ -468,10 +474,6 @@ main(int argc, char **argv) if (arg == argc) { goto Usage; } - fprintf(fout, "LIBRARY %s\n", dllname); - fprintf(fout, "EXETYPE WINDOWS\n"); - fprintf(fout, "CODE PRELOAD MOVEABLE DISCARDABLE\n"); - fprintf(fout, "DATA PRELOAD MOVEABLE MULTIPLE\n\n"); fprintf(fout, "EXPORTS\n"); } -- cgit v0.12