Truncate trailing forward slashes(/)
ClosedPublic

Authored by shubham on Apr 17 2019, 7:56 AM.

Details

Test Plan

Ran ctest
kmountpointtest still passes

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
shubham created this revision.Apr 17 2019, 7:56 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 17 2019, 7:56 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
shubham requested review of this revision.Apr 17 2019, 7:56 AM
dfaure requested changes to this revision.Apr 17 2019, 12:30 PM
dfaure added inline comments.
src/core/kmountpoint.cpp
164–168

That would turn "/boot/efi" into "/boot" !!

I wonder, did kmountpointtest still pass?

You want something like this instead:

if (mountedFrom.endsWith('/')) {
    mountedFrom.chop(1);
}
This revision now requires changes to proceed.Apr 17 2019, 12:30 PM
shubham updated this revision to Diff 56437.Apr 17 2019, 2:01 PM
shubham marked an inline comment as done.

Correcty chop trailing slash

shubham edited the test plan for this revision. (Show Details)Apr 17 2019, 2:02 PM
dfaure accepted this revision.Apr 17 2019, 4:06 PM

Patch looks good now ;-)

I'm curious about one more thing: what prompted this change? Did you have a mount point with a trailing slash, or was it just to "fix a TODO" (which, hehe, has been there since the very beginning of this code in 2003)?

This revision is now accepted and ready to land.Apr 17 2019, 4:06 PM
This revision was automatically updated to reflect the committed changes.

@dfaure Intention was just to fix the TODO