Skip to content

Commit

Permalink
libretro: Use an empty base directory if the frontend doesn't provide…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
RobLoach authored Mar 2, 2025
1 parent cac4490 commit a433563
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/physfs_platform_libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
if (dir == NULL)
physfs_platform_libretro_environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir);

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

dir_length = strlen(dir);
retval = allocator.Malloc(dir_length + 2);
Expand Down

0 comments on commit a433563

Please sign in to comment.