From 7e0d30e86d0c634215e852fd6d5afffe8d84ccc8 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 4 Sep 2002 16:00:47 +0000 Subject: [PATCH] Plugin command changed to plugin::command without .dll git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@906 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/Plugins.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/Source/Plugins.cpp b/Source/Plugins.cpp index 99c74f73..d2a4cb6b 100644 --- a/Source/Plugins.cpp +++ b/Source/Plugins.cpp @@ -64,6 +64,8 @@ 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; FILE* dll = fopen(pathToDll,"rb"); if (dll) @@ -136,28 +138,7 @@ bool Plugins::IsPluginCommand(char* token) char* Plugins::GetPluginDll(char* command) { - bool malloced = false; - char *colons = strstr(command,"::"); - if (!colons) return 0; - - *colons = 0; - - char *p = command; - - while (*p != '.' && *p) p++; - - if (lstrcmpi(p, ".dll")) { - char *new_command = (char *)malloc(lstrlen(command)+1+4); - wsprintf(new_command, "%s.dll::%s", command, colons+2); - command = new_command; - malloced = 1; - } - - *colons = ':'; - - char *result = m_commands.find(command); - if (malloced) free(command); - return result; + return m_commands.find(command); } void Plugins::StoreInstDLL(char* dllName)