- 
    
Bug
 - 
    Resolution: Fixed
 - 
    
P3: Somewhat important
 - 
    6.8.1
 - 
    None
 
- 
        
 - 
        7d05f5ed7 (dev), 86597d289 (6.9), 09f047079 (6.8)
 
With Qt 6.8.1, the following code
auto url = QUrl::fromUserInput(QStringLiteral("/tmp/..///asdf/")); auto adjusted = url.adjusted(QUrl::NormalizePathSegments); qCritical() << url << adjusted;
prints
QUrl("file:///tmp/..///asdf/") QUrl("")
With Qt 5.15.16 (and, as far as I know, with Qt 6.8.0), the same code prints
QUrl("file:///tmp/..///asdf/") QUrl("file:///asdf/")
Qt Test prints more information about the invalid URL:
Invalid URL: Path component starts with '//' and authority is absent; source was "//asdf/"; scheme = "file", path = "//asdf/"
This regression causes a failure of KDevelop's TestPath unit test, but I am not aware of any problems for non-test code.
| For Gerrit Dashboard: QTBUG-133403 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 621923,3 | QUrl: set the host to empty but present for "file" URLs | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 622441,2 | QUrl: set the host to empty but present for "file" URLs | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 622453,3 | QUrl: set the host to empty but present for "file" URLs | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |