diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 7c79b0b44f..5e79dbed50 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -383,15 +383,16 @@ const char *path_get_extension(const char *path) * Only '.'s after the last slash are considered. * * Returns: path with the extension part removed. + * If there is no extension at the end of path, + * returns a pointer to the unaltered original path. */ char *path_remove_extension(char *path) { char *last = !string_is_empty(path) ? (char*)strrchr(path_basename(path), '.') : NULL; if (!last) - return NULL; - if (*last) - *last = '\0'; + return path; + *last = '\0'; return path; } diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 654c799828..ff70552ee0 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -2368,7 +2368,9 @@ RETRO_API bool retro_unserialize(const void *data, size_t size); RETRO_API void retro_cheat_reset(void); RETRO_API void retro_cheat_set(unsigned index, bool enabled, const char *code); -/* Loads a game. */ +/* Loads a game. + * Return true to indicate successful loading and false to indicate load failure. + */ RETRO_API bool retro_load_game(const struct retro_game_info *game); /* Loads a "special" kind of game. Should not be used, @@ -2378,7 +2380,7 @@ RETRO_API bool retro_load_game_special( const struct retro_game_info *info, size_t num_info ); -/* Unloads a currently loaded game. */ +/* Unloads the currently loaded game. Called before retro_deinit(void). */ RETRO_API void retro_unload_game(void); /* Gets region of game. */