mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-24 04:32:11 +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
|
// change to the directory where we found srb2.pk3
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
|
waddir = _fullpath(NULL, waddir, MAX_PATH);
|
||||||
SetCurrentDirectoryA(waddir);
|
SetCurrentDirectoryA(waddir);
|
||||||
#else
|
#else
|
||||||
|
waddir = realpath(waddir, NULL);
|
||||||
if (chdir(waddir) == -1)
|
if (chdir(waddir) == -1)
|
||||||
I_OutputMsg("Couldn't change working directory\n");
|
I_OutputMsg("Couldn't change working directory\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3087,8 +3087,10 @@ const char *I_LocateWad(void)
|
||||||
{
|
{
|
||||||
// change to the directory where we found srb2.pk3
|
// change to the directory where we found srb2.pk3
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
|
waddir = _fullpath(NULL, waddir, MAX_PATH);
|
||||||
SetCurrentDirectoryA(waddir);
|
SetCurrentDirectoryA(waddir);
|
||||||
#else
|
#else
|
||||||
|
waddir = realpath(waddir, NULL);
|
||||||
if (chdir(waddir) == -1)
|
if (chdir(waddir) == -1)
|
||||||
I_OutputMsg("Couldn't change working directory\n");
|
I_OutputMsg("Couldn't change working directory\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue