wininet file scheme

Nick Cronin quintok at gmail.com
Mon Jun 19 01:38:17 CDT 2006


Skipped content of type multipart/alternative-------------- next part --------------
Index: wine/dlls/wininet/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/internet.c,v
retrieving revision 1.179
diff -u -p -r1.179 internet.c
--- wine/dlls/wininet/internet.c	2 Jun 2006 19:12:55 -0000	1.179
+++ wine/dlls/wininet/internet.c	17 Jun 2006 06:12:40 -0000
@@ -1377,7 +1377,11 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lp
         /* double slash indicates the net_loc portion is present */
         if ((lpszcp[0] == '/') && (lpszcp[1] == '/'))
         {
-            lpszcp += 2;
+            /* three slashes is possible in 'file' scheme */
+            if( lpszcp[2] == '/' && lpUC->nScheme == INTERNET_SCHEME_FILE )
+                lpszcp+= 3;
+            else
+                lpszcp += 2;
 
             lpszNetLoc = strpbrkW(lpszcp, lpszSlash);
             if (lpszParam)
Index: wine/dlls/wininet/tests/url.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/tests/url.c,v
retrieving revision 1.4
diff -u -p -r1.4 url.c
--- wine/dlls/wininet/tests/url.c	14 Jun 2006 11:54:31 -0000	1.4
+++ wine/dlls/wininet/tests/url.c	17 Jun 2006 06:12:43 -0000
@@ -39,6 +39,11 @@
 #define TEST_URL2_PATHEXTRA "/myscript.php?arg=1"
 #define TEST_URL2_EXTRA "?arg=1"
 #define TEST_URL3 "file:///C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml"
+#define TEST_URL3_URL "C:\\Program Files\\Atmel\\AVR Tools\\STK500\\STK500.xml"
+#define TEST_URL4 "file://C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml"
+#define TEST_URL4_URL "C:\\Program%20Files\\Atmel\\AVR%20Tools\\STK500\\STK500.xml"
+#define TEST_URL5 "http:///www.winehq.org"
+#define TEST_URL5_URL "/www.winehq.org"
 
 #define CREATE_URL1 "http://username:[email protected]/site/about"
 #define CREATE_URL2 "http://[email protected]/site/about"
@@ -208,6 +213,23 @@ static void InternetCrackUrl_test(void)
   ok(!strcmp(urlComponents.lpszScheme, "about"), "lpszScheme was \"%s\" instead of \"about\"\n", urlComponents.lpszScheme);
   ok(!strcmp(urlComponents.lpszHostName, "host"), "lpszHostName was \"%s\" instead of \"host\"\n", urlComponents.lpszHostName);
   ok(!strcmp(urlComponents.lpszUrlPath, "/blank"), "lpszUrlPath was \"%s\" instead of \"/blank\"\n", urlComponents.lpszUrlPath);
+
+  todo_wine
+  copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
+  InternetCrackUrlA( TEST_URL3, 0, ICU_DECODE, &urlComponents );
+  ok( strcmp( urlComponents.lpszUrlPath, TEST_URL3_URL ) == 0, 
+     "InternetCrackUrl returned \"%s\" expected was \"%s\"\n", urlComponents.lpszUrlPath, TEST_URL3_URL );
+
+  todo_wine
+  copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
+  InternetCrackUrlA( TEST_URL4, 0, ICU_DECODE, &urlComponents );
+  ok( strcmp( urlComponents.lpszUrlPath, TEST_URL4_URL ) == 0,
+     "InternetCrackUrl returned \"%s\" expected was \"%s\"\n", urlComponents.lpszUrlPath, TEST_URL4_URL );
+
+  copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
+  InternetCrackUrlA( TEST_URL5, 0, ICU_DECODE, &urlComponents );
+  ok( strcmp( urlComponents.lpszUrlPath, TEST_URL5_URL ) == 0,
+     "InternetCrackUrl returned \"%s\" expected was \"%s\"\n", urlComponents.lpszUrlPath, TEST_URL5_URL );
 }
 
 static void InternetCrackUrlW_test(void)


More information about the wine-devel mailing list