From a05b0f6c61f41133e1d7eab387a8a53f3896a9af Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 11 Mar 2004 19:29:04 +0000 Subject: [PATCH] made search for .dll in plug-in names case insensitive git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3511 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/Plugins.cpp | 16 +++++++++++++--- Source/script.cpp | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Source/Plugins.cpp b/Source/Plugins.cpp index 34ca4198..09884648 100644 --- a/Source/Plugins.cpp +++ b/Source/Plugins.cpp @@ -51,7 +51,7 @@ void Plugins::FindCommands(char* path,bool displayInfo) } } -void Plugins::GetExports(char* pathToDll,bool displayInfo) +void Plugins::GetExports(char* pathToDll, bool displayInfo) { if (pathToDll) { @@ -64,8 +64,18 @@ void Plugins::GetExports(char* pathToDll,bool displayInfo) dllName[0] = 0; char* ptr = strrchr(pathToDll,'\\'); if (ptr && *ptr && *(ptr+1)) strcpy(dllName,ptr+1); - ptr = strstr(dllName, ".dll"); - if (ptr) *ptr = 0; + + // find .dll + char *dllName2 = strdup(dllName); + for (ptr = dllName2; *ptr; ptr = CharNext(ptr)) + { + if (!strcmpi(ptr, ".dll")) + { + *(dllName + (ptr - dllName2)) = 0; + break; + } + } + free(dllName2); FILE* dll = fopen(pathToDll,"rb"); if (dll) diff --git a/Source/script.cpp b/Source/script.cpp index ed156b31..478bcb5a 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -3442,8 +3442,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) char b[255]; for (unsigned int spos=0; (spos <= strlen(s)) && (spos <= 255); spos++) b[spos]=toupper(*(s+spos)); - strcpy(s,b); - + strcpy(s,b); + if (*s) { int c=0;