]> granicus.if.org Git - php/commitdiff
make parse_url work correctly for file uri's on windows, such as
authorShane Caraveo <shane@php.net>
Sun, 19 Oct 2003 20:00:51 +0000 (20:00 +0000)
committerShane Caraveo <shane@php.net>
Sun, 19 Oct 2003 20:00:51 +0000 (20:00 +0000)
file:///c:/somepath/somefile.txt

ext/standard/url.c

index cdddbf00f1e8b172a81f596f6fca3b700c999197..419b8146e9088ce6ddc883c900b1cb1efb85d5fb 100644 (file)
@@ -126,6 +126,12 @@ PHPAPI php_url *php_url_parse(char *str)
                                s = e + 3;
                                if (!strncasecmp("file", ret->scheme, sizeof("file"))) {
                                        if (*(e + 3) == '/') {
+                                               /* support windows drive letters as in:
+                                                  file:///c:/somedir/file.txt
+                                               */
+                                               if (*(e + 5) == ':') {
+                                                       s = e + 4;
+                                               }
                                                goto nohost;
                                        }
                                }