src/platform_unix.c
changeset 1213 050ee17c6e99
parent 1211 09280603503b
child 1230 ca5575b87b22
equal deleted inserted replaced
1212:e3cd2449fe8e 1213:050ee17c6e99
   288 
   288 
   289     return retval;
   289     return retval;
   290 } /* __PHYSFS_platformCalcBaseDir */
   290 } /* __PHYSFS_platformCalcBaseDir */
   291 
   291 
   292 
   292 
   293 char *__PHYSFS_platformRealPath(const char *path)
       
   294 {
       
   295     char resolved_path[MAXPATHLEN];
       
   296     char *retval = NULL;
       
   297 
       
   298     errno = 0;
       
   299     BAIL_IF_MACRO(!realpath(path, resolved_path), strerror(errno), NULL);
       
   300     retval = (char *) allocator.Malloc(strlen(resolved_path) + 1);
       
   301     BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
       
   302     strcpy(retval, resolved_path);
       
   303 
       
   304     return retval;
       
   305 } /* __PHYSFS_platformRealPath */
       
   306 
       
   307 
       
   308 int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
   293 int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
   309 {
   294 {
   310     return 0;  /* just use malloc() and friends. */
   295     return 0;  /* just use malloc() and friends. */
   311 } /* __PHYSFS_platformSetDefaultAllocator */
   296 } /* __PHYSFS_platformSetDefaultAllocator */
   312 
   297