diff --git a/core_info.c b/core_info.c index 207b654a63..46a41139b6 100644 --- a/core_info.c +++ b/core_info.c @@ -1567,9 +1567,6 @@ bool core_info_set_core_lock(const char *core_path, bool lock) strlcat(lock_file_path, FILE_PATH_LOCK_EXTENSION, sizeof(lock_file_path)); - if (string_is_empty(lock_file_path)) - return false; - /* Check whether lock file exists */ lock_file_exists = path_is_valid(lock_file_path); @@ -1658,9 +1655,6 @@ bool core_info_get_core_lock(const char *core_path, bool validate_path) strlcat(lock_file_path, FILE_PATH_LOCK_EXTENSION, sizeof(lock_file_path)); - if (string_is_empty(lock_file_path)) - return false; - /* Check whether lock file exists */ is_locked = path_is_valid(lock_file_path); diff --git a/libretro-common/file/file_path_io.c b/libretro-common/file/file_path_io.c index acd6ab4e1a..63587e3928 100644 --- a/libretro-common/file/file_path_io.c +++ b/libretro-common/file/file_path_io.c @@ -110,7 +110,6 @@ int32_t path_get_size(const char *path) **/ bool path_mkdir(const char *dir) { - bool sret = false; bool norecurse = false; char *basedir = NULL; @@ -132,15 +131,9 @@ bool path_mkdir(const char *dir) return false; } - if (path_is_directory(basedir)) + if ( path_is_directory(basedir) + || path_mkdir(basedir)) norecurse = true; - else - { - sret = path_mkdir(basedir); - - if (sret) - norecurse = true; - } free(basedir); @@ -151,9 +144,8 @@ bool path_mkdir(const char *dir) /* Don't treat this as an error. */ if (ret == -2 && path_is_directory(dir)) return true; - - return (ret == 0); + else if (ret == 0) + return true; } - - return sret; + return false; }