File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,18 @@ Global $g__sTorPath = "" ; Path to Tor.exe
5555; Author ........: Damon Harris (TheDcoder)
5656; Remarks .......: $TOR_VERSION Format : x.x.x.x (git-a1b2c3d4e5f6g7h8)
5757; Example: 0.2.9.10 (git-1f6c8eda0073f464)
58+ ; The git hash may not be present at all times.
5859; Example .......: No
5960; ===============================================================================================================================
6061Func _Tor_CheckVersion($sTorPath = $g__sTorPath )
6162 Local $sOutput = _Process_RunCommand($PROCESS_RUNWAIT , $sTorPath & ' --version' )
6263 If @error Then Return SetError ($TOR_ERROR_PROCESS , @error , False )
63- Local $aTorVersion = StringRegExp ($sOutput , ' ([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) \(git-([a-z0-9]{16})\)' , $STR_REGEXPARRAYFULLMATCH )
64+ Local $aTorVersion [3 ]
65+ Local $aRegEx = StringRegExp ($sOutput , ' (\d*\.\d*\.\d*\.\d*)(?: \(git-([a-z0-9]{16})\))?' , $STR_REGEXPARRAYFULLMATCH )
6466 If @error Then Return SetError ($TOR_ERROR_VERSION , @error , False )
67+ $aTorVersion [$TOR_VERSION ] = $aRegEx [0 ]
68+ $aTorVersion [$TOR_VERSION_NUMBER ] = $aRegEx [1 ]
69+ If UBound ($aRegEx ) = 3 Then $aTorVersion [$TOR_VERSION_GIT ] = $aRegEx [2 ]
6570 Return $aTorVersion
6671EndFunc
6772
You can’t perform that action at this time.
0 commit comments