From cdacbb8b84543267d5d0bd9f23257780c977d4f9 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 2 Feb 2007 19:51:06 +0000 Subject: [PATCH] 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 --- Include/TextFunc.nsh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Include/TextFunc.nsh b/Include/TextFunc.nsh index 7d8cce26..3e08f8c7 100644 --- a/Include/TextFunc.nsh +++ b/Include/TextFunc.nsh @@ -62,6 +62,8 @@ TrimNewLines !ifndef TEXTFUNC_INCLUDED !define TEXTFUNC_INCLUDED +!include FileFunc.nsh + !verbose push !verbose 3 !ifndef _TEXTFUNC_VERBOSE @@ -192,12 +194,23 @@ TrimNewLines !verbose pop !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 !ifndef ${_TEXTFUNC_UN}LineFind !verbose push !verbose ${_TEXTFUNC_VERBOSE} !define ${_TEXTFUNC_UN}LineFind `!insertmacro ${_TEXTFUNC_UN}LineFindCall` + !insertmacro ${_TEXTFUNC_UN}GetParent + Function ${_TEXTFUNC_UN}LineFind Exch $3 Exch @@ -304,10 +317,11 @@ TrimNewLines goto $7 file: - StrCmp $1 '/NUL' +4 - GetTempFileName $R4 + StrCmp $1 '/NUL' notemp + !insertmacro _TextFunc_TempFileForFile $1 $R4 Push $R4 FileOpen $R4 $R4 w + notemp: FileOpen $R5 $0 r IfErrors preerror @@ -609,6 +623,8 @@ TrimNewLines !verbose ${_TEXTFUNC_VERBOSE} !define ${_TEXTFUNC_UN}FileJoin `!insertmacro ${_TEXTFUNC_UN}FileJoinCall` + !insertmacro ${_TEXTFUNC_UN}GetParent + Function ${_TEXTFUNC_UN}FileJoin Exch $2 Exch @@ -636,9 +652,10 @@ TrimNewLines StrCpy $2 '' StrCmp $2 '' 0 +3 StrCpy $4 $0 - goto +3 - GetTempFileName $4 + Goto notemp + !insertmacro _TextFunc_TempFileForFile $2 $4 CopyFiles /SILENT $0 $4 + notemp: FileOpen $3 $4 a IfErrors error FileSeek $3 -1 END