Bug 312060 - KUrl::adjustPath(KUrl::AddTrailingSlash) adds trailing slash to sftp://localhost
Summary: KUrl::adjustPath(KUrl::AddTrailingSlash) adds trailing slash to sftp://localhost
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.9.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-22 03:19 UTC by Benni Hill
Modified: 2013-01-06 09:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benni Hill 2012-12-22 03:19:35 UTC
KUrl::adjustPath(KUrl::AddTrailingSlash) adds a trailing slash to "sftp://localhost".

This should not happen because "sftp://localhost" means something completely different than "sftp://localhost/".

This behaviour is also conflicting with the doc which says:
"If the URL has no path, then no '/' is added anyway."

Reproducible: Always

Steps to Reproduce:
1. KUrl url("sftp://localhost");
2. url.adjustPath(KUrl::AddTrailingSlash);

Actual Results:  
The url is "sftp://localhost/" now.

Expected Results:  
The url should stay "sftp://localhost".
Comment 1 David Faure 2013-01-06 09:48:57 UTC
Git commit e29b9a028ded7c7c8b72c0a3e742644ff986f2e1 by David Faure.
Committed on 06/01/2013 at 10:50.
Pushed by dfaure into branch 'KDE/4.10'.

Fix adjustPath(AddTrailingSlash) to preserve empty paths

As per the documentation.
FIXED-IN: 4.10
REVIEW: 108215

M  +1    -1    kdecore/io/kurl.cpp
M  +9    -0    kdecore/tests/kurltest.cpp

http://commits.kde.org/kdelibs/e29b9a028ded7c7c8b72c0a3e742644ff986f2e1