Skip to content

Commit 3cf3681

Browse files
RobLoachicculus
authored andcommitted
libretro: Use an empty base directory if the frontend doesn't provide one
When a frontend doesn't implement GET_SYSTEM_DIRECTORY, or GET_GAME_INFO, it would provide / as the base directory. This change switches it to use `""`, instead. The root directory should likely not be used as the base dir.
1 parent cac4490 commit 3cf3681

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/physfs_platform_libretro.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
112112
if (dir == NULL)
113113
physfs_platform_libretro_environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir);
114114

115-
/* as a last case, use / */
115+
/* as a last case, provide an empty string, assuming the platform resolves a working directory */
116116
if (dir == NULL)
117-
dir = "/";
117+
dir = "";
118118

119119
dir_length = strlen(dir);
120120
retval = allocator.Malloc(dir_length + 2);

0 commit comments

Comments
 (0)