Apparently BeOS's BPath constructor doesn't actually _need_ leaf to be
manually split out.
This commit is contained in:
parent
95cbc6bed2
commit
afd7163321
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
11052006 - More 7zip archiver work (thanks, Dennis!). Initial Unicode work.
|
11052006 - More 7zip archiver work (thanks, Dennis!). Initial Unicode work.
|
||||||
|
Minor BeOS realpath tweak.
|
||||||
09272006 - Reworked 7zip archiver (thanks, Dennis!).
|
09272006 - Reworked 7zip archiver (thanks, Dennis!).
|
||||||
09232006 - Fixed typo in doxygen comment.
|
09232006 - Fixed typo in doxygen comment.
|
||||||
04112006 - Added LZMA archiver...7zip support (thanks, Dennis!).
|
04112006 - Added LZMA archiver...7zip support (thanks, Dennis!).
|
||||||
|
|
|
@ -200,14 +200,7 @@ void __PHYSFS_platformTimeslice(void)
|
||||||
|
|
||||||
char *__PHYSFS_platformRealPath(const char *path)
|
char *__PHYSFS_platformRealPath(const char *path)
|
||||||
{
|
{
|
||||||
char *str = (char *) alloca(strlen(path) + 1);
|
BPath normalized(path, NULL, true); /* force normalization of path. */
|
||||||
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. */
|
|
||||||
const char *resolved_path = normalized.Path();
|
const char *resolved_path = normalized.Path();
|
||||||
BAIL_IF_MACRO(resolved_path == NULL, ERR_NO_SUCH_FILE, NULL);
|
BAIL_IF_MACRO(resolved_path == NULL, ERR_NO_SUCH_FILE, NULL);
|
||||||
char *retval = (char *) allocator.Malloc(strlen(resolved_path) + 1);
|
char *retval = (char *) allocator.Malloc(strlen(resolved_path) + 1);
|
||||||
|
|
Loading…
Reference in New Issue