From 62c3903d7f15962c709850421e2186f489a6fb2c Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 23 Jun 2005 22:34:35 +0000 Subject: [PATCH] look for _?= in the entire command line in case realcmds skipped the first and only space as a question mark is an invalid character in file names, this method shouldn't have false positives git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4132 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 97a33805..dcaebe1d 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -166,15 +166,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT if (g_is_uninstaller) { - char *p = findchar(realcmds, 0); + char *p = findchar(state_command_line, 0); // state_command_line has state_install_directory right after it in memory, so reading // a bit over state_command_line won't do any harm - while (p >= realcmds && *(LPDWORD)p != CHAR4_TO_DWORD(' ', '_', '?', '=')) p--; + while (p >= state_command_line && *(LPDWORD)p != CHAR4_TO_DWORD(' ', '_', '?', '=')) p--; m_Err = _LANG_UNINSTINITERROR; - if (p >= realcmds) + if (p >= state_command_line) { *p=0; // terminate before "_?=" p+=4; // skip over " _?="