Bug 312060

Summary: KUrl::adjustPath(KUrl::AddTrailingSlash) adds trailing slash to sftp://localhost
Product: [Frameworks and Libraries] kdelibs Reporter: Benni Hill <benni>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.9.4   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.10

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