|
|
@@ -200,14 +200,7 @@ void __PHYSFS_platformTimeslice(void)
|
|
|
|
|
|
char *__PHYSFS_platformRealPath(const char *path)
|
|
|
{
|
|
|
- char *str = (char *) alloca(strlen(path) + 1);
|
|
|
- BAIL_IF_MACRO(str == NULL, ERR_OUT_OF_MEMORY, NULL);
|
|
|
- strcpy(str, path);
|
|
|
- char *leaf = strrchr(str, '/');
|
|
|
- if (leaf != NULL)
|
|
|
- *(leaf++) = '\0';
|
|
|
-
|
|
|
- BPath normalized(str, leaf, true); /* force normalization of path. */
|
|
|
+ BPath normalized(path, NULL, true); /* force normalization of path. */
|
|
|
const char *resolved_path = normalized.Path();
|
|
|
BAIL_IF_MACRO(resolved_path == NULL, ERR_NO_SUCH_FILE, NULL);
|
|
|
char *retval = (char *) allocator.Malloc(strlen(resolved_path) + 1);
|