mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-23 12:21:07 +00:00
Convert waddir to an absolute path
Since we change directories to the waddir, if waddir is a relative path, it will be invalidated after changing directories. Converting it to an absolute path means we can change directories without messing anything up. Fixes #1310
This commit is contained in:
parent
987d2ee59a
commit
0a611b0f09
2 changed files with 4 additions and 0 deletions
|
@ -1453,8 +1453,10 @@ const char *I_LocateWad(void)
|
|||
{
|
||||
// change to the directory where we found srb2.pk3
|
||||
#if defined (_WIN32)
|
||||
waddir = _fullpath(NULL, waddir, MAX_PATH);
|
||||
SetCurrentDirectoryA(waddir);
|
||||
#else
|
||||
waddir = realpath(waddir, NULL);
|
||||
if (chdir(waddir) == -1)
|
||||
I_OutputMsg("Couldn't change working directory\n");
|
||||
#endif
|
||||
|
|
|
@ -3087,8 +3087,10 @@ const char *I_LocateWad(void)
|
|||
{
|
||||
// change to the directory where we found srb2.pk3
|
||||
#if defined (_WIN32)
|
||||
waddir = _fullpath(NULL, waddir, MAX_PATH);
|
||||
SetCurrentDirectoryA(waddir);
|
||||
#else
|
||||
waddir = realpath(waddir, NULL);
|
||||
if (chdir(waddir) == -1)
|
||||
I_OutputMsg("Couldn't change working directory\n");
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue