[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:47:22 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cd9ab05ab5f9056851f4658b0bce0b766a111d65
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 5 05:58:13 2002 +0000

    Tests:
    
            * harness.c: (main): Stop using debug versions of frameworks.
    	This was causing us problems we'd see only in the test programs,
    	and we didn't see the text of the asserts. We can turn this back
    	on again if we make it so we can see what's wrong.
    
            * WebFoundation-Misc/ifnsurlextensions-test.chk: Update for new
    	expected results that handle "../" properly.
    
            * kde/kurl-test.chk: Update for canonicalization, which was added
    	a while back without updating this test.
    
    WebFoundation:
    
    	- fixed 3064420 -- NSURLExtras function does not resolve "../"
    	URLs at top level the way the web expects
    
            * Misc.subproj/WebNSURLExtras.m:
            (+[NSURL _web_URLWithString:relativeToURL:]): Added code to
    	detect URL results that have paths that start with /../ and
    	remove the extra levels. Tested with the Tests directory.
    
            * English.lproj/StringsNotToBeLocalized.txt: Added the string used
    	as a localization exception.
    
    WebCore:
    
            * kwq/KWQKURL.mm: (KURL::parse): Fix code that adds "//" to file URLs.
    	The code was including the extra slashes as part of the path, which they are not.
    	Verified with the tests in the Tests directory.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2259 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index c900e4f..90a2791 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,9 @@
+2002-10-04  Darin Adler  <darin at apple.com>
+
+        * kwq/KWQKURL.mm: (KURL::parse): Fix code that adds "//" to file URLs.
+	The code was including the extra slashes as part of the path, which they are not.
+	Verified with the tests in the Tests directory.
+
 2002-10-03  Darin Adler  <darin at apple.com>
 
 	- fixed 3065730 -- Crash loading "My T-Mobile" page (in khtml::Decoder::decode)
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c900e4f..90a2791 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,9 @@
+2002-10-04  Darin Adler  <darin at apple.com>
+
+        * kwq/KWQKURL.mm: (KURL::parse): Fix code that adds "//" to file URLs.
+	The code was including the extra slashes as part of the path, which they are not.
+	Verified with the tests in the Tests directory.
+
 2002-10-03  Darin Adler  <darin at apple.com>
 
 	- fixed 3065730 -- Crash loading "My T-Mobile" page (in khtml::Decoder::decode)
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c900e4f..90a2791 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,9 @@
+2002-10-04  Darin Adler  <darin at apple.com>
+
+        * kwq/KWQKURL.mm: (KURL::parse): Fix code that adds "//" to file URLs.
+	The code was including the extra slashes as part of the path, which they are not.
+	Verified with the tests in the Tests directory.
+
 2002-10-03  Darin Adler  <darin at apple.com>
 
 	- fixed 3065730 -- Crash loading "My T-Mobile" page (in khtml::Decoder::decode)
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index bd6d345..d09551e 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -941,7 +941,6 @@ void KURL::parse(const char *url, const QString *originalString)
 
     char *p = buffer;
     const char *strPtr = url;
-    bool isHTTPorHTTPS, isFILE;
 
     // copy in the scheme
     const char *schemeEndPtr = url + schemeEnd;
@@ -951,16 +950,21 @@ void KURL::parse(const char *url, const QString *originalString)
     schemeEndPos = p - buffer;
 
     // Check if we're http or https.
-    isHTTPorHTTPS = strncasecmp ("http", url, schemeEnd) == 0 ||
+    bool isHTTPorHTTPS = strncasecmp ("http", url, schemeEnd) == 0 ||
         strncasecmp ("https", url, schemeEnd) == 0;
     
-    isFILE = (strncasecmp("file", url, schemeEnd) == 0);
+    bool isFILENeedsHostPart = strncasecmp("file", url, schemeEnd) == 0 && pathStart != pathEnd
+        && !(pathStart + 2 == pathEnd && strncmp("//", url + pathStart, 2) == 0);
+    
+    bool hostIsLocalHost = portEnd - userStart == 9 && strncmp(url + userStart, "localhost", 9) == 0;
+    
+    bool haveNonHostAuthorityPart = userStart != userEnd || passwordStart != passwordEnd || portStart != portEnd;
     
     // add ";"
     *p++ = ':';
 
-    // we have at least one authority part - add "//"
-    if ((userStart != userEnd || passwordStart != passwordEnd || hostStart != hostEnd || portStart != portEnd) && !(portEnd - userStart == 9 && strncmp(url + userStart, "localhost", 9) == 0)) {
+    // if we have at least one authority part or a file URL - add "//"
+    if (isFILENeedsHostPart || ((haveNonHostAuthorityPart || hostStart != hostEnd) && !hostIsLocalHost)) {
 	*p++ = '/';
 	*p++ = '/';
 
@@ -991,11 +995,13 @@ void KURL::parse(const char *url, const QString *originalString)
 	}
 	
 	// copy in the host
-	strPtr = url + hostStart;
-	const char *hostEndPtr = url + hostEnd;
-	while (strPtr < hostEndPtr) {
-	    *p++ = *strPtr++;
-	}
+	if (!isFILENeedsHostPart || !hostIsLocalHost || haveNonHostAuthorityPart) {
+            strPtr = url + hostStart;
+            const char *hostEndPtr = url + hostEnd;
+            while (strPtr < hostEndPtr) {
+                *p++ = *strPtr++;
+            }
+        }
 	hostEndPos = p - buffer;
 	
 	// copy in the port
@@ -1012,12 +1018,6 @@ void KURL::parse(const char *url, const QString *originalString)
 	userStartPos = userEndPos = passwordEndPos = hostEndPos = portEndPos = p - buffer;
     }
 
-    // For canonicalization, ensure we have a 'file://' before the path.
-    if (isFILE && (p - buffer) == 5 && (pathEnd - pathStart) >= 2 && strcmp(&url[pathStart], "//") != 0){
-        *p++ = '/';
-        *p++ = '/';
-    }
-
     // For canonicalization, ensure we have a '/' for no path.
     // Only do this for http and https.
     if (isHTTPorHTTPS && pathEnd - pathStart == 0) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list