I think your right Travis, there is a difference however I'm not removing it per-say.  If file:// is sent, InternetCrackUrl does not take out the %xx ascii values, however if file:/// is sent, it does.  I've added a test case for these both.  I also wrote a test case for http:/// which currently the code I'm suggesting passes (although the output is useless).

On 6/17/06, Travis Watkins <[EMAIL PROTECTED]> wrote:
On 6/16/06, Mike McCormack <[EMAIL PROTECTED]> wrote:
>
> Nick Cronin wrote:
> > unlike http:// etc, file:/// has 3 slashes, this patch removes the third
> > slash.
>
> Could you provide a test case for this please?
>
> Specifically, is "http:///foo.bar" different to "http://foo.bar "?  Your
> code treats them equally.  How about "file:///" and "file://"?
>
> Mike
>
>
>

I thought it was file://computername/path/to/file with
file:///path/to/file implying the local machine. I'm not so sure this
should be changed, it's some kind of a standard.

--
Travis Watkins
http://www.realistanew.com

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)


Reply via email to