mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Allow all systems to check for backslashes (Windows) as last slash in path. Improves portable core logic (#15612)
This commit is contained in:
parent
24287b1cce
commit
c5c86fe5e8
@ -347,21 +347,20 @@ size_t fill_pathname(char *out_path, const char *in_path,
|
||||
* @size : size of path
|
||||
*
|
||||
* Find last slash in path. Tries to find
|
||||
* a backslash on Windows too which takes precedence
|
||||
* over regular slash.
|
||||
* a backslash as used for Windows paths,
|
||||
* otherwise checks for a regular slash.
|
||||
|
||||
* @return pointer to last slash/backslash found in @str.
|
||||
**/
|
||||
char *find_last_slash(const char *str)
|
||||
{
|
||||
const char *slash = strrchr(str, '/');
|
||||
#ifdef _WIN32
|
||||
const char *backslash = strrchr(str, '\\');
|
||||
|
||||
if (!slash || (backslash > slash))
|
||||
return (char*)backslash;
|
||||
#endif
|
||||
return (char*)slash;
|
||||
else
|
||||
return (char*)slash;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user