getRealPath uses the write directory if it can't get the real directory

This commit is contained in:
Bradley Bell 2004-12-05 10:56:32 +00:00
parent 5a091ee718
commit 0569d6ee66
2 changed files with 11 additions and 2 deletions

View file

@ -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>
* include/cfile.h, include/physfsx.h: use PATH_MAX for hog

View file

@ -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 $ */
/*
*
@ -83,7 +83,11 @@ static inline int PHYSFSX_getRealPath(const char *stdPath, char *realPath)
char *p;
if (!realDir)
return 0;
{
realDir = PHYSFS_getWriteDir();
if (!realDir)
return 0;
}
strncpy(realPath, realDir, PATH_MAX - 1);
if (strlen(realPath) >= strlen(sep))