From 38e5a6c425267686da01e8b9660c75803605a983 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Fri, 29 Dec 2000 03:26:27 +0000 Subject: [PATCH] Allow stubs for exports that are not legal C identifiers. --- tools/winebuild/spec32.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 5daeabb9174..54da038d209 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -34,8 +34,15 @@ static int string_compare( const void *ptr1, const void *ptr2 ) static const char *make_internal_name( const ORDDEF *odp, const char *prefix ) { static char buffer[256]; - if (odp->name[0]) sprintf( buffer, "__wine_%s_%s_%s", prefix, DLLName, odp->name ); - else sprintf( buffer, "__wine_%s_%s_%d", prefix, DLLName, odp->ordinal ); + if (odp->name[0]) + { + char *p; + sprintf( buffer, "__wine_%s_%s_%s", prefix, DLLName, odp->name ); + /* make sure name is a legal C identifier */ + for (p = buffer; *p; p++) if (!isalnum(*p) && *p != '_') break; + if (!*p) return buffer; + } + sprintf( buffer, "__wine_%s_%s_%d", prefix, DLLName, odp->ordinal ); return buffer; }