Archived
1
0

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)
This commit is contained in:
mbirth 2007-05-08 06:55:43 +00:00
parent 6454757d0e
commit 4267762598
3 changed files with 13 additions and 7 deletions

View File

@ -238,10 +238,12 @@ Else
Loop %dattxt0% Loop %dattxt0%
{ {
Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/dattxt0, Translating paths in file %CurFile% ... Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/dattxt0, Translating paths in file %CurFile% ...
CurFile := dattxt%A_Index% CurMask := dattxt%A_Index%
IfExist %U3_APP_DATA_PATH%\%CurFile% 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 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% ... 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% 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). 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 If dattxt0 > 0

View File

@ -110,10 +110,12 @@ If (ForeignSettings = "0")
Loop %dattxt0% Loop %dattxt0%
{ {
Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/dattxt0, Translating paths in file %CurFile% ... Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/dattxt0, Translating paths in file %CurFile% ...
CurFile := dattxt%A_Index% CurMask := dattxt%A_Index%
IfExist %U3_APP_DATA_PATH%\%CurFile% 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 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% ... 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% 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). 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 If dattxt0 > 0

View File

@ -45,7 +45,7 @@ EnvSort()
{ {
CurNam := EnvVarsx%A_Index% CurNam := EnvVarsx%A_Index%
CurVal := EnvValsx%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) MaxLen := StrLen(CurVal)
MaxIndex := A_Index MaxIndex := A_Index