From a3c2163a3342b0f1574402d675f26f15c33df441 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Thu, 19 Jul 2012 21:15:23 -0400 Subject: [PATCH] Now only uses "mysticbbs" environment variable if mystic.dat is not in same directory --- mystic/maketheme.pas | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/mystic/maketheme.pas b/mystic/maketheme.pas index 86f4a24..5c41183 100644 --- a/mystic/maketheme.pas +++ b/mystic/maketheme.pas @@ -195,24 +195,29 @@ Begin Halt (1); End; - BasePath := GetENV('mysticbbs'); - - If BasePath <> '' Then BasePath := DirSlash(BasePath); - Action := strUpper(ParamStr(1)); InFN := ParamStr(2); OutFN := ParamStr(3); FileMode := 2; - Assign (ConfigFile, BasePath + 'mystic.dat'); + Assign (ConfigFile, 'mystic.dat'); Reset (ConfigFile); If IoResult <> 0 Then Begin - WriteLn ('ERROR: Unable to read MYSTIC.DAT'); - WriteLn; - WriteLn ('MYSTIC.DAT must exist in the same directory as MakeTheme, or in the'); - WriteLn ('path defined by the MYSTICBBS environment variable.'); - Halt (1); + BasePath := GetENV('mysticbbs'); + + If BasePath <> '' Then BasePath := DirSlash(BasePath); + + Assign (ConfigFile, BasePath + 'mystic.dat'); + Reset (ConfigFile); + + If IoResult <> 0 Then Begin + WriteLn ('ERROR: Unable to read MYSTIC.DAT'); + WriteLn; + WriteLn ('MYSTIC.DAT must exist in the same directory as MakeTheme, or in the'); + WriteLn ('path defined by the MYSTICBBS environment variable.'); + Halt (1); + End; End; Read (ConfigFile, bbsConfig);