From 64de3cbcce20ae25a0a3891f1aaaa88606c91f30 Mon Sep 17 00:00:00 2001 From: Brian G Date: Thu, 22 Apr 2021 17:55:45 -0700 Subject: [PATCH] [Scripter] * BUG: Fix md5sum when path presents with a leading ./ which the shell does not expand --- app/src/gbs3/.src/ScriptMain.module | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/gbs3/.src/ScriptMain.module b/app/src/gbs3/.src/ScriptMain.module index bb8485802..0ec074ff2 100644 --- a/app/src/gbs3/.src/ScriptMain.module +++ b/app/src/gbs3/.src/ScriptMain.module @@ -114,9 +114,15 @@ Public Sub ScripterMain(aArgs As String[]) As Integer If Not $oContext.$bExecuteFromArgs And If Not $oContext.$bScriptSourceStdIn Then ' md5sum requires the absolute path unless we are using a shell which expands it so ./ddd and ~/ can not be calculated for md5sum Process - If Not Exist($sPath) Then - If File.Dir($sPath) = "" Then $sPath = Env["PWD"] &/ $sPath + Dim sPathPart As String = File.Dir($sPath) + If Not Exist($sPath) Or If sPathPart[0] = "." Then + If sPathPart = "" Then + $sPath = Env["PWD"] &/ $sPath + Else If sPathPart[0] = "." + $sPath = Env["PWD"] &/ Right($sPath, -1) + Endif Endif + $sPath = File.RealPath($sPath) sName = File.Name($sPath)