1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-25 09:44:21 +00:00

path: don't accept empty protocol as valid

mp_is_url("://") returned true.
This commit is contained in:
wm4 2013-12-22 23:05:12 +01:00
parent 3782fa20ed
commit 8c0675b7d0

View File

@ -219,7 +219,7 @@ bool mp_path_isdir(const char *path)
bool mp_is_url(bstr path) bool mp_is_url(bstr path)
{ {
int proto = bstr_find0(path, "://"); int proto = bstr_find0(path, "://");
if (proto < 0) if (proto < 1)
return false; return false;
// The protocol part must be alphanumeric, otherwise it's not an URL. // The protocol part must be alphanumeric, otherwise it's not an URL.
for (int i = 0; i < proto; i++) { for (int i = 0; i < proto; i++) {