WININET: fix the dwUrlPathLength returned by InternetCrackUrl when lpszExtraInfo is null

Mike McCormack mike at codeweavers.com
Fri Aug 6 00:18:30 CDT 2004


ChangeLog:
* fix the dwUrlPathLength returned by InternetCrackUrl when 
lpszExtraInfo is null
-------------- next part --------------
Index: dlls/wininet/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/internet.c,v
retrieving revision 1.92
diff -u -r1.92 internet.c
--- dlls/wininet/internet.c	23 Jul 2004 23:00:07 -0000	1.92
+++ dlls/wininet/internet.c	6 Aug 2004 03:56:05 -0000
@@ -1155,6 +1155,9 @@
 {
     TRACE("%s (%d)\n", debugstr_wn(lpszStart,len), len);
 
+    if ( (*dwComponentLen == 0) && (*lppszComponent == NULL) )
+        return FALSE;
+
     if (*dwComponentLen != 0 || *lppszComponent == NULL)
     {
         if (*lppszComponent == NULL)
@@ -1221,11 +1224,8 @@
     lpszParam = strpbrkW(lpszap, lpszSeparators);
     if (lpszParam != NULL)
     {
-        if (!SetUrlComponentValueW(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength,
-                                   lpszParam, dwUrlLength-(lpszParam-lpszUrl)))
-        {
-            return FALSE;
-        }
+        SetUrlComponentValueW(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength,
+                                   lpszParam, dwUrlLength-(lpszParam-lpszUrl));
     }
 
     if (bIsAbsolute) /* Parse <protocol>:[//<net_loc>] */
@@ -1235,9 +1235,8 @@
 
         /* Get scheme first. */
         lpUC->nScheme = GetInternetSchemeW(lpszUrl, lpszcp - lpszUrl);
-        if (!SetUrlComponentValueW(&lpUC->lpszScheme, &lpUC->dwSchemeLength,
-                                   lpszUrl, lpszcp - lpszUrl))
-            return FALSE;
+        SetUrlComponentValueW(&lpUC->lpszScheme, &lpUC->dwSchemeLength,
+                                   lpszUrl, lpszcp - lpszUrl);
 
         /* Eat ':' in protocol. */
         lpszcp++;
@@ -1374,7 +1373,7 @@
         /* Only truncate the parameter list if it's already been saved
          * in lpUC->lpszExtraInfo.
          */
-        if (lpszParam && lpUC->dwExtraInfoLength)
+        if (lpszParam && lpUC->dwExtraInfoLength && lpUC->lpszExtraInfo)
             len = lpszParam - lpszcp;
         else
         {
@@ -1388,9 +1387,8 @@
                 len = dwUrlLength-(lpszcp-lpszUrl);
         }
 
-        if (!SetUrlComponentValueW(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength,
-                                   lpszcp, len))
-            return FALSE;
+        SetUrlComponentValueW(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength,
+                                   lpszcp, len);
     }
     else
     {


More information about the wine-patches mailing list