Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…end,_prepend,_and_remove_entries for trapping long strings

Refs #330

git-svn-id: https://svn.nexusformat.org/code/trunk@1844 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
  • Loading branch information
FreddieAkeroyd authored and Freddie Akeroyd committed Sep 18, 2012
1 parent 1f3f069 commit 02ba4fd
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion cmake_modules/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,31 @@ Function ${UN}EnvVarUpdate
DetailPrint "ERROR: PathString is blank"
Goto EnvVarUpdate_Restore_Vars
${EndIf}


;; From http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries
;; khc - here check if length is going to be greater then max string length
;; and abort if so - also abort if original path empty - may mean
;; it was too long as well- write message to say set it by hand
Push $6
Push $7
Push $8
StrLen $7 $4
StrLen $6 $5
IntOp $8 $6 + $7
${If} $5 == ""
${OrIf} $8 >= ${NSIS_MAX_STRLEN}
SetErrors
DetailPrint "Current $1 length ($6) too long to modify in NSIS; set manually if needed"
Pop $8
Pop $7
Pop $6
Goto EnvVarUpdate_Restore_Vars
${EndIf}
Pop $8
Pop $7
Pop $6
;;khc

; Make sure we've got some work to do
${If} $5 == ""
${AndIf} $2 == "R"
Expand Down

0 comments on commit 02ba4fd

Please sign in to comment.