- Look for files in Mac-like places on Macs.
- Fixed: The non-Windows CreatePath can fail if part of the path already exists, because mkdir will return an error code for trying to recreate an existing directory. SVN r1814 (trunk)
This commit is contained in:
parent
12576d2eb5
commit
66920536d9
9 changed files with 119 additions and 100 deletions
|
|
@ -396,34 +396,6 @@ static int CheckIWAD (const char *doomwaddir, WadStuff *wads)
|
|||
return numfound;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// CheckIWADinEnvDir
|
||||
//
|
||||
// Checks for an IWAD in a path that contains one or more environment
|
||||
// variables.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static int CheckIWADinEnvDir (const char *str, WadStuff *wads)
|
||||
{
|
||||
FString expanded = ExpandEnvVars (str);
|
||||
|
||||
if (!expanded.IsEmpty())
|
||||
{
|
||||
char *dir = expanded.LockBuffer ();
|
||||
FixPathSeperator (dir);
|
||||
expanded.UnlockBuffer ();
|
||||
if (expanded[expanded.Len() - 1] != '/')
|
||||
{
|
||||
expanded += '/';
|
||||
}
|
||||
return CheckIWAD (expanded, wads);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// IdentifyVersion
|
||||
|
|
@ -484,21 +456,10 @@ static EIWADType IdentifyVersion (const char *zdoom_wad)
|
|||
{
|
||||
if (stricmp (key, "Path") == 0)
|
||||
{
|
||||
if (strchr (value, '$') != NULL)
|
||||
{
|
||||
CheckIWADinEnvDir (value, wads);
|
||||
}
|
||||
#ifdef unix
|
||||
else if (*value == '~' && (*(value + 1) == 0 || *(value + 1) == '/'))
|
||||
{
|
||||
FString homepath = GetUserFile (*(value + 1) ? value + 2 : value + 1, true);
|
||||
CheckIWAD (homepath, wads);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
CheckIWAD (value, wads);
|
||||
}
|
||||
FString nice = NicePath(value);
|
||||
FixPathSeperator(nice.LockBuffer());
|
||||
nice.UnlockBuffer();
|
||||
CheckIWAD(nice, wads);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue