made the command line parser cut right on /D= and _?= and not one char before. this way foo.exe "bla"/D=..., which appears to be valid in other applications, will not get the last quote cut off.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3468 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5ffa23ff64
commit
4e3f2c485e
2 changed files with 9 additions and 8 deletions
|
@ -112,13 +112,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
||||||
{
|
{
|
||||||
// skip over any spaces
|
// skip over any spaces
|
||||||
while (*cmdline == ' ') cmdline++;
|
while (*cmdline == ' ') cmdline++;
|
||||||
// find out if this parm is quoted
|
|
||||||
|
// get char we should look for to get the next parm
|
||||||
|
seekchar = ' ';
|
||||||
if (cmdline[0] == '\"')
|
if (cmdline[0] == '\"')
|
||||||
{
|
{
|
||||||
cmdline++;
|
cmdline++;
|
||||||
seekchar = '\"';
|
seekchar = '\"';
|
||||||
}
|
}
|
||||||
else seekchar = ' ';
|
|
||||||
|
// is it a switch?
|
||||||
if (cmdline[0] == '/')
|
if (cmdline[0] == '/')
|
||||||
{
|
{
|
||||||
cmdline++;
|
cmdline++;
|
||||||
|
@ -137,9 +140,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
||||||
|
|
||||||
if (*(WORD*)cmdline == CHAR2_TO_WORD('D','='))
|
if (*(WORD*)cmdline == CHAR2_TO_WORD('D','='))
|
||||||
{
|
{
|
||||||
cmdline[-2]=0; // keep this from being passed to uninstaller if necessary
|
cmdline[-1]=0; // keep this from being passed to uninstaller if necessary
|
||||||
mystrcpy(state_install_directory,cmdline+2);
|
mystrcpy(state_install_directory,cmdline+2);
|
||||||
cmdline=""; // prevent further processing of cmdline
|
break; // /D= must always be last
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,8 +159,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
||||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||||
if (g_is_uninstaller)
|
if (g_is_uninstaller)
|
||||||
{
|
{
|
||||||
char *p=realcmds;
|
char *p = findchar(realcmds, 0);
|
||||||
while (*p) p++;
|
|
||||||
|
|
||||||
while (p >= realcmds && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
while (p >= realcmds && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
||||||
|
|
||||||
|
@ -165,7 +167,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
||||||
|
|
||||||
if (p >= realcmds)
|
if (p >= realcmds)
|
||||||
{
|
{
|
||||||
*(p-1)=0; // terminate before the " _?="
|
*p=0; // terminate before the "_?="
|
||||||
p+=3; // skip over _?=
|
p+=3; // skip over _?=
|
||||||
if (is_valid_instpath(p))
|
if (is_valid_instpath(p))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1644,7 +1644,6 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||||
item.pszText = ptr;
|
item.pszText = ptr;
|
||||||
item.cchTextMax = total;
|
item.cchTextMax = total;
|
||||||
SendMessage(linsthwnd,LVM_GETITEMTEXT,i,(LPARAM)&item);
|
SendMessage(linsthwnd,LVM_GETITEMTEXT,i,(LPARAM)&item);
|
||||||
//while (*ptr) ptr++;
|
|
||||||
ptr += mystrlen(ptr);
|
ptr += mystrlen(ptr);
|
||||||
*(WORD*)ptr = CHAR2_TO_WORD('\r','\n');
|
*(WORD*)ptr = CHAR2_TO_WORD('\r','\n');
|
||||||
ptr+=2;
|
ptr+=2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue