Change-Id: I1fd0fe4b9b67996732c85c1792415e371e865595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
d->appendPath(url, options, QUrlPrivate::FullUrl);
// check if we need to remove trailing slashes
- if ((options & StripTrailingSlash) && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/')))
+ if ((options & StripTrailingSlash) && !d->path.isEmpty() && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/')))
url.chop(1);
}
QTest::newRow("file slash") << "file:///dir/" << "file:///dir";
QTest::newRow("file no slash") << "file:///dir/" << "file:///dir";
QTest::newRow("file root") << "file:///" << "file:///";
+ QTest::newRow("no path") << "remote://" << "remote://";
}
void tst_QUrl::stripTrailingSlash()