Now checks current directory before mysticbbs environment variable.

This commit is contained in:
mysticbbs 2012-08-24 13:19:43 -04:00
parent c64481a7ed
commit e86ed5cc6a
1 changed files with 14 additions and 9 deletions

View File

@ -81,17 +81,22 @@ Var
FileConfig : TBufFile;
DatLoc : String;
Begin
DatLoc := GetEnv('mysticbbs');
If DatLoc <> '' Then DatLoc := DirSlash(DatLoc);
FileConfig := TBufFile.Create(SizeOf(RecConfig));
If Not FileConfig.Open(DatLoc + 'mystic.dat', fmOpen, fmReadWrite + fmDenyNone, SizeOf(RecConfig)) Then Begin
WriteLn;
WriteLn ('ERROR: Unable to read MYSTIC.DAT. This file must exist in the same');
WriteLn ('directory as MIS');
Halt (1);
If Not FileConfig.Open('mystic.dat', fmOpen, fmReadWrite + fmDenyNone, SizeOf(RecConfig)) Then Begin
DatLoc := GetEnv('mysticbbs');
If DatLoc <> '' Then DatLoc := DirSlash(DatLoc);
If Not FileConfig.Open(DatLoc + 'mystic.dat', fmOpen, fmReadWrite + fmDenyNone, SizeOf(RecConfig)) Then Begin
WriteLn;
WriteLn ('ERROR: Unable to read MYSTIC.DAT. This file must exist in the same');
WriteLn ('directory as MIS');
FileConfig.Free;
Halt (1);
End;
End;
FileConfig.Read(bbsConfig);