Changeset 1042 for trunk


Ignore:
Timestamp:
Sep 1, 2011, 6:40:32 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

Don't eat drive letters in QDir::cleanPath().

For paths like "D:/../myfile", it would return "myfile" on all platforms while on
e.g. Windows and OS/2 "D:/" means the root directory and must not be removed.
Now, cleanPath() will leave it as "D:/../myfile" in such cases (similar to Linux
returning "/../myfile" unmodified).

The correctness of "/../myfile" itself is questionable (at least Linux treats such
paths as if there was no ".." and so does the native OS/2 call when resolving the
absolute file path), but it's a different story.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/io/qdir.cpp

    r883 r1042  
    20412041    if (dir_separator != QLatin1Char('/'))
    20422042       name.replace(dir_separator, QLatin1Char('/'));
     2043
     2044
     2045
     2046
    20432047
    20442048    int used = 0, levels = 0;
     
    21522156    }
    21532157
     2158
     2159
     2160
    21542161    return ret;
    21552162}
Note: See TracChangeset for help on using the changeset viewer.