⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 104885 in webkit


Ignore:
Timestamp:
Jan 12, 2012, 5:27:28 PM (15 years ago)
Author:
ap@apple.com
Message:

NSURL to KURL conversion shouldn't turn raw paths into file URLs
https://bugs.webkit.org/show_bug.cgi?id=76234

Reviewed by Darin Adler.

  • platform/mac/KURLMac.mm: (WebCore::KURL::KURL): Removed this code.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104879 r104885  
     12012-01-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        NSURL to KURL conversion shouldn't turn raw paths into file URLs
     4        https://bugs.webkit.org/show_bug.cgi?id=76234
     5
     6        Reviewed by Darin Adler.
     7
     8        * platform/mac/KURLMac.mm: (WebCore::KURL::KURL): Removed this code.
     9
    1102012-01-12  Anders Carlsson  <andersca@apple.com>
    211
  • trunk/Source/WebCore/platform/mac/KURLMac.mm

    r101713 r104885  
    4343
    4444    CFIndex bytesLength = CFURLGetBytes(reinterpret_cast<CFURLRef>(url), 0, 0);
    45     Vector<char, 512> buffer(bytesLength + 6); // 5 for "file:", 1 for null character to end C string
    46     char* bytes = &buffer[5];
     45    Vector<char, 512> buffer(bytesLength + 1);
     46    char* bytes = &buffer[0];
    4747    CFURLGetBytes(reinterpret_cast<CFURLRef>(url), reinterpret_cast<UInt8*>(bytes), bytesLength);
    4848    bytes[bytesLength] = '\0';
    49     if (bytes[0] != '/') {
    50         parse(bytes);
    51         return;
    52     }
    53 
    54     buffer[0] = 'f';
    55     buffer[1] = 'i';
    56     buffer[2] = 'l';
    57     buffer[3] = 'e';
    58     buffer[4] = ':';
    59 
    60     parse(buffer.data());
     49    parse(bytes);
    6150}
    6251
Note: See TracChangeset for help on using the changeset viewer.