Changeset 84075 in webkit


Ignore:
Timestamp:
Apr 15, 2011 8:40:05 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-04-15 Dirk Pranke <dpranke@chromium.org>

Reviewed by Ojan Vafai.

fix MockFileSystem.abspath() on windows
https://bugs.webkit.org/show_bug.cgi?id=58713

The existing code was borked on Windows if a path was passed
in using a drive letter (e.g., "d:\foo.txt"), and would go
into an infinite recursive loop. While win paths shouldn't
normally be passed into the mock filesystem, this just
bulletproofs things a bit (note that "/foo.txt" is considered
an absolute path on windows python as well.

  • Scripts/webkitpy/common/system/filesystem_mock.py:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84074 r84075  
     12011-04-15  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        fix MockFileSystem.abspath() on windows
     6        https://bugs.webkit.org/show_bug.cgi?id=58713
     7
     8        The existing code was borked on Windows if a path was passed
     9        in using a drive letter (e.g., "d:\foo.txt"), and would go
     10        into an infinite recursive loop. While win paths shouldn't
     11        normally be passed into the mock filesystem, this just
     12        bulletproofs things a bit (note that "/foo.txt" is considered
     13        an absolute path on windows python as well.
     14
     15        * Scripts/webkitpy/common/system/filesystem_mock.py:
     16
    1172011-04-15  Ojan Vafai  <ojan@chromium.org>
    218
  • trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py

    r83631 r84075  
    6464
    6565    def abspath(self, path):
    66         if path.startswith(self.sep):
     66        if os.path.isabs(path):
    6767            return self.normpath(path)
    6868        return self.abspath(self.join(self.cwd, path))
Note: See TracChangeset for help on using the changeset viewer.