From 426776259837bc178e1eb22c4deb422c588b13cc Mon Sep 17 00:00:00 2001 From: mbirth Date: Tue, 8 May 2007 06:55:43 +0000 Subject: [PATCH] x fixed bug where HOMEPATH with only a backslash produced garbage on another system (now envvars < 2 chars are ignored) * made TextParser work with file masks (Issue: 13) --- U3H_hostCleanUp.ahk | 9 ++++++--- U3H_hostConfigure.ahk | 9 ++++++--- mb_EnvTools.ahk | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/U3H_hostCleanUp.ahk b/U3H_hostCleanUp.ahk index 07e6d60..4180780 100644 --- a/U3H_hostCleanUp.ahk +++ b/U3H_hostCleanUp.ahk @@ -238,10 +238,12 @@ Else Loop %dattxt0% { Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/dattxt0, Translating paths in file %CurFile% ... - CurFile := dattxt%A_Index% - IfExist %U3_APP_DATA_PATH%\%CurFile% + CurMask := dattxt%A_Index% + SetWorkingDir %U3_APP_DATA_PATH% + Loop %CurMask% { - TmpFile := "$$$" . CurFile + CurFile := A_LoopFileFullPath + TmpFile := A_LoopFileDir . "\$$$" . A_LoopFileName FileMove %U3_APP_DATA_PATH%\%CurFile%, %U3_APP_DATA_PATH%\%TmpFile%, 1 Progress % StepsPos*StepsStep+StepsStep*(A_Index-0.5)/dattxt0, Translating paths in file %CurFile% ... Loop Read, %U3_APP_DATA_PATH%\%TmpFile%, %U3_APP_DATA_PATH%\%CurFile% @@ -264,6 +266,7 @@ Else MsgBox 4112, Error while translating, The datafile %CurFile% could not be translated. The original state has been restored (hopefully). } } + SetWorkingDir %A_ScriptDir% } If dattxt0 > 0 diff --git a/U3H_hostConfigure.ahk b/U3H_hostConfigure.ahk index c894bf1..acead8e 100644 --- a/U3H_hostConfigure.ahk +++ b/U3H_hostConfigure.ahk @@ -110,10 +110,12 @@ If (ForeignSettings = "0") Loop %dattxt0% { Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/dattxt0, Translating paths in file %CurFile% ... - CurFile := dattxt%A_Index% - IfExist %U3_APP_DATA_PATH%\%CurFile% + CurMask := dattxt%A_Index% + SetWorkingDir %U3_APP_DATA_PATH% + Loop %CurMask% { - TmpFile := "$$$" . CurFile + CurFile := A_LoopFileFullPath + TmpFile := A_LoopFileDir . "\$$$" . A_LoopFileName FileMove %U3_APP_DATA_PATH%\%CurFile%, %U3_APP_DATA_PATH%\%TmpFile%, 1 Progress % StepsPos*StepsStep+StepsStep*(A_Index-0.5)/dattxt0, Translating paths in file %CurFile% ... Loop Read, %U3_APP_DATA_PATH%\%TmpFile%, %U3_APP_DATA_PATH%\%CurFile% @@ -137,6 +139,7 @@ Loop %dattxt0% MsgBox 4112, Error while translating, The datafile %CurFile% could not be translated. The original state has been restored (hopefully). } } + SetWorkingDir %A_ScriptDir% } If dattxt0 > 0 diff --git a/mb_EnvTools.ahk b/mb_EnvTools.ahk index 2a1f838..4b6ead7 100644 --- a/mb_EnvTools.ahk +++ b/mb_EnvTools.ahk @@ -45,7 +45,7 @@ EnvSort() { CurNam := EnvVarsx%A_Index% CurVal := EnvValsx%A_Index% - If ((StrLen(CurVal) > MaxLen) and (StrLen(CurNam) > 0)) + If ((StrLen(CurVal) > MaxLen) and (StrLen(CurNam) > 1)) { MaxLen := StrLen(CurVal) MaxIndex := A_Index