improved GetParant, GetParameters

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2918 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-09-15 19:18:18 +00:00
parent f5046135d9
commit 624f7225f4

View file

@ -17,15 +17,17 @@
\c Exch $R0 ; old $R0 is on top of stack
\c Push $R1
\c Push $R2
\c StrCpy $R1 -1
\c Push $R3
\c StrLen $R3 $R0
\c loop:
\c StrCpy $R2 $R0 1 $R1
\c StrCmp $R2 "" exit
\c StrCmp $R2 "\" exit
\c IntOp $R1 $R1 - 1
\c IntCmp $R1 -$R3 exit exit
\c StrCpy $R2 $R0 1 $R1
\c StrCmp $R2 "\" exit
\c Goto loop
\c exit:
\c StrCpy $R0 $R0 $R1
\c Pop $R3
\c Pop $R2
\c Pop $R1
\c Exch $R0 ; put $R0 on top of stack, restore $R0 to original value
@ -71,15 +73,17 @@
\c Push $R0
\c Push $R1
\c Push $R2
\c Push $R3
\c StrCpy $R0 $CMDLINE 1
\c StrCpy $R1 '"'
\c StrCpy $R2 1
\c StrLen $R3 $CMDLINE
\c StrCmp $R0 '"' loop
\c StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
\c loop:
\c StrCpy $R0 $CMDLINE 1 $R2
\c StrCmp $R0 $R1 loop2
\c StrCmp $R0 "" loop2
\c StrCmp $R2 $R3 loop2
\c IntOp $R2 $R2 + 1
\c Goto loop
\c loop2:
@ -87,6 +91,7 @@
\c StrCpy $R0 $CMDLINE 1 $R2
\c StrCmp $R0 " " loop2
\c StrCpy $R0 $CMDLINE "" $R2
\c Pop $R3
\c Pop $R2
\c Pop $R1
\c Exch $R0
@ -568,7 +573,7 @@
\c Pop $R0
\c StrCmp $R0 "online" connected
\c MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
\c Quit ;Remove to make error not fatal
\c Quit ;This will quit the installer. You might want to add your own error handling.
\c
\c noie3:
\c