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:
@ -232,12 +232,14 @@ char *mp_basename(const char *path)
|
|||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
#if HAVE_DOS_PATHS
|
#if HAVE_DOS_PATHS
|
||||||
s = strrchr(path, '\\');
|
if (!mp_is_url(bstr0(path))) {
|
||||||
if (s)
|
s = strrchr(path, '\\');
|
||||||
path = s + 1;
|
if (s)
|
||||||
s = strrchr(path, ':');
|
path = s + 1;
|
||||||
if (s)
|
s = strrchr(path, ':');
|
||||||
path = s + 1;
|
if (s)
|
||||||
|
path = s + 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
s = strrchr(path, '/');
|
s = strrchr(path, '/');
|
||||||
return s ? s + 1 : (char *)path;
|
return s ? s + 1 : (char *)path;
|
||||||
|
Reference in New Issue
Block a user