X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftext%2Fstrings.c;h=a53907d655bed735590cf297fd8620590f321cfb;hb=615bcffe5297b99422ffec435228ac015ae12d64;hp=fa1b39cfe05eadc81c708c39f5147f58767dec57;hpb=db6104c7f94c9da5a3dbcfcda5a03757d32d51fa;p=vlc diff --git a/src/text/strings.c b/src/text/strings.c index fa1b39cfe0..a53907d655 100644 --- a/src/text/strings.c +++ b/src/text/strings.c @@ -1048,11 +1048,16 @@ char *make_URI (const char *path, const char *scheme) char *buf; #ifdef WIN32 + /* Drive letter */ if (isalpha (path[0]) && (path[1] == ':')) { - if (asprintf (&buf, "%s:///%c:", scheme ? scheme : "file", path[0]) == -1) + if (asprintf (&buf, "%s:///%c:", scheme ? scheme : "file", + path[0]) == -1) buf = NULL; path += 2; +# warning Drive letter-relative path not implemented! + if (path[0] != DIR_SEP_CHAR) + return NULL; } else #endif @@ -1088,6 +1093,9 @@ char *make_URI (const char *path, const char *scheme) snprintf (buf, sizeof (SMB_SCHEME) + 3 + hostlen, SMB_SCHEME"://%s", path + 2); path += 2 + hostlen; + + if (path[0] == '\0') + return buf; /* Hostname without path */ } else if (path[0] != DIR_SEP_CHAR)