mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-12 13:51:27 +00:00
(SDK) Minor cleanups in file_list.c/file_path.c
This commit is contained in:
parent
c255387282
commit
7c4307329a
@ -48,9 +48,9 @@ void file_list_push(file_list_t *list,
|
||||
|
||||
size_t file_list_get_size(const file_list_t *list)
|
||||
{
|
||||
if (list)
|
||||
return list->size;
|
||||
return 0;
|
||||
if (!list)
|
||||
return 0;
|
||||
return list->size;
|
||||
}
|
||||
|
||||
size_t file_list_get_directory_ptr(const file_list_t *list)
|
||||
|
@ -69,9 +69,9 @@
|
||||
const char *path_get_extension(const char *path)
|
||||
{
|
||||
const char *ext = strrchr(path_basename(path), '.');
|
||||
if (ext)
|
||||
return ext + 1;
|
||||
return "";
|
||||
if (!ext)
|
||||
return "";
|
||||
return ext + 1;
|
||||
}
|
||||
|
||||
char *path_remove_extension(char *path)
|
||||
@ -144,13 +144,11 @@ bool path_file_exists(const char *path)
|
||||
{
|
||||
FILE *dummy = fopen(path, "rb");
|
||||
|
||||
if (dummy)
|
||||
{
|
||||
fclose(dummy);
|
||||
return true;
|
||||
}
|
||||
if (!dummy)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
fclose(dummy);
|
||||
return true;
|
||||
}
|
||||
|
||||
void fill_pathname(char *out_path, const char *in_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user