getRealPath uses the write directory if it can't get the real directory
This commit is contained in:
parent
5a091ee718
commit
0569d6ee66
|
@ -1,3 +1,8 @@
|
||||||
|
2004-12-05 Chris Taylor <c.taylor@student.curtin.edu.au>
|
||||||
|
|
||||||
|
* include/physfsx.h: getRealPath uses the write directory if it
|
||||||
|
can't get the real directory
|
||||||
|
|
||||||
2004-12-03 Bradley Bell <btb@icculus.org>
|
2004-12-03 Bradley Bell <btb@icculus.org>
|
||||||
|
|
||||||
* include/cfile.h, include/physfsx.h: use PATH_MAX for hog
|
* include/cfile.h, include/physfsx.h: use PATH_MAX for hog
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: physfsx.h,v 1.6 2004-12-04 04:07:16 btb Exp $ */
|
/* $Id: physfsx.h,v 1.7 2004-12-05 10:56:32 btb Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@ -82,8 +82,12 @@ static inline int PHYSFSX_getRealPath(const char *stdPath, char *realPath)
|
||||||
const char *sep = PHYSFS_getDirSeparator();
|
const char *sep = PHYSFS_getDirSeparator();
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
if (!realDir)
|
||||||
|
{
|
||||||
|
realDir = PHYSFS_getWriteDir();
|
||||||
if (!realDir)
|
if (!realDir)
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
strncpy(realPath, realDir, PATH_MAX - 1);
|
strncpy(realPath, realDir, PATH_MAX - 1);
|
||||||
if (strlen(realPath) >= strlen(sep))
|
if (strlen(realPath) >= strlen(sep))
|
||||||
|
|
Loading…
Reference in a new issue