1
mirror of https://github.com/mpv-player/mpv synced 2025-08-16 10:50:04 +02:00

path: handle URLs consistently in mp_basename

Detect URLs and skip DOS path processing as it is likely to do
unexpected thing when ":" is found.
This commit is contained in:
Kacper Michajłow
2023-06-01 22:41:07 +02:00
committed by sfan5
parent 83acd93c6a
commit c1bef0f084

@ -232,12 +232,14 @@ char *mp_basename(const char *path)
char *s;
#if HAVE_DOS_PATHS
if (!mp_is_url(bstr0(path))) {
s = strrchr(path, '\\');
if (s)
path = s + 1;
s = strrchr(path, ':');
if (s)
path = s + 1;
}
#endif
s = strrchr(path, '/');
return s ? s + 1 : (char *)path;