fixed bug #1631773 - file permission problem with ${LineFind}
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4918 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
7fd83c7114
commit
cdacbb8b84
1 changed files with 21 additions and 4 deletions
|
@ -62,6 +62,8 @@ TrimNewLines
|
||||||
!ifndef TEXTFUNC_INCLUDED
|
!ifndef TEXTFUNC_INCLUDED
|
||||||
!define TEXTFUNC_INCLUDED
|
!define TEXTFUNC_INCLUDED
|
||||||
|
|
||||||
|
!include FileFunc.nsh
|
||||||
|
|
||||||
!verbose push
|
!verbose push
|
||||||
!verbose 3
|
!verbose 3
|
||||||
!ifndef _TEXTFUNC_VERBOSE
|
!ifndef _TEXTFUNC_VERBOSE
|
||||||
|
@ -192,12 +194,23 @@ TrimNewLines
|
||||||
!verbose pop
|
!verbose pop
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
!macro _TextFunc_TempFileForFile _FILE _RESULT
|
||||||
|
${${_TEXTFUNC_UN}GetParent} ${_FILE} ${_RESULT}
|
||||||
|
StrCmp ${_RESULT} "" 0 +2
|
||||||
|
StrCpy ${_RESULT} $EXEDIR
|
||||||
|
GetTempFileName ${_RESULT} ${_RESULT}
|
||||||
|
StrCmp ${_RESULT} "" 0 +2
|
||||||
|
GetTempFileName ${_RESULT}
|
||||||
|
!macroend
|
||||||
|
|
||||||
!macro LineFind
|
!macro LineFind
|
||||||
!ifndef ${_TEXTFUNC_UN}LineFind
|
!ifndef ${_TEXTFUNC_UN}LineFind
|
||||||
!verbose push
|
!verbose push
|
||||||
!verbose ${_TEXTFUNC_VERBOSE}
|
!verbose ${_TEXTFUNC_VERBOSE}
|
||||||
!define ${_TEXTFUNC_UN}LineFind `!insertmacro ${_TEXTFUNC_UN}LineFindCall`
|
!define ${_TEXTFUNC_UN}LineFind `!insertmacro ${_TEXTFUNC_UN}LineFindCall`
|
||||||
|
|
||||||
|
!insertmacro ${_TEXTFUNC_UN}GetParent
|
||||||
|
|
||||||
Function ${_TEXTFUNC_UN}LineFind
|
Function ${_TEXTFUNC_UN}LineFind
|
||||||
Exch $3
|
Exch $3
|
||||||
Exch
|
Exch
|
||||||
|
@ -304,10 +317,11 @@ TrimNewLines
|
||||||
goto $7
|
goto $7
|
||||||
|
|
||||||
file:
|
file:
|
||||||
StrCmp $1 '/NUL' +4
|
StrCmp $1 '/NUL' notemp
|
||||||
GetTempFileName $R4
|
!insertmacro _TextFunc_TempFileForFile $1 $R4
|
||||||
Push $R4
|
Push $R4
|
||||||
FileOpen $R4 $R4 w
|
FileOpen $R4 $R4 w
|
||||||
|
notemp:
|
||||||
FileOpen $R5 $0 r
|
FileOpen $R5 $0 r
|
||||||
IfErrors preerror
|
IfErrors preerror
|
||||||
|
|
||||||
|
@ -609,6 +623,8 @@ TrimNewLines
|
||||||
!verbose ${_TEXTFUNC_VERBOSE}
|
!verbose ${_TEXTFUNC_VERBOSE}
|
||||||
!define ${_TEXTFUNC_UN}FileJoin `!insertmacro ${_TEXTFUNC_UN}FileJoinCall`
|
!define ${_TEXTFUNC_UN}FileJoin `!insertmacro ${_TEXTFUNC_UN}FileJoinCall`
|
||||||
|
|
||||||
|
!insertmacro ${_TEXTFUNC_UN}GetParent
|
||||||
|
|
||||||
Function ${_TEXTFUNC_UN}FileJoin
|
Function ${_TEXTFUNC_UN}FileJoin
|
||||||
Exch $2
|
Exch $2
|
||||||
Exch
|
Exch
|
||||||
|
@ -636,9 +652,10 @@ TrimNewLines
|
||||||
StrCpy $2 ''
|
StrCpy $2 ''
|
||||||
StrCmp $2 '' 0 +3
|
StrCmp $2 '' 0 +3
|
||||||
StrCpy $4 $0
|
StrCpy $4 $0
|
||||||
goto +3
|
Goto notemp
|
||||||
GetTempFileName $4
|
!insertmacro _TextFunc_TempFileForFile $2 $4
|
||||||
CopyFiles /SILENT $0 $4
|
CopyFiles /SILENT $0 $4
|
||||||
|
notemp:
|
||||||
FileOpen $3 $4 a
|
FileOpen $3 $4 a
|
||||||
IfErrors error
|
IfErrors error
|
||||||
FileSeek $3 -1 END
|
FileSeek $3 -1 END
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue