Fixed TrimNewLines (thanks pengyou)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2348 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-03-21 12:38:11 +00:00
parent 03cafaf818
commit 43cb9c03bc

View file

@ -39,23 +39,27 @@
\c ; modifies no other variables.
\c
\c Function TrimNewlines
\c Exch $R0
\c Push $R1
\c Push $R2
\c Exch $R0
\c Push $R1
\c Push $R2
\c StrCpy $R1 0
\c loop:
\c IntOp $R1 $R1 - 1
\c StrCpy $R2 $R0 1 $R1
\c StrCmp $R2 "$\r" loop
\c StrCmp $R2 "$\n" loop
\c IntOp $R1 $R1 + 1
\c
\c
\c loop:
\c IntOp $R1 $R1 - 1
\c StrCpy $R2 $R0 1 $R1
\c StrCmp $R2 "$\r" loop
\c StrCmp $R2 "$\n" loop
\c IntOp $R1 $R1 + 1
\c IntCmp $R1 0 no_trim_needed
\c StrCpy $R0 $R0 $R1
\c Pop $R2
\c Pop $R1
\c Exch $R0
\c
\c no_trim_needed:
\c Pop $R2
\c Pop $R1
\c Exch $R0
\c FunctionEnd
\H{getparameters} Get command line parameters
\c ; GetParameters