Bug 381028

Summary: Missing path separator when backing up from scanned directory
Product: [Applications] filelight Reporter: asl97
Component: generalAssignee: Martin Sandsmark <martin.sandsmark>
Status: RESOLVED FIXED    
Severity: normal CC: asl97, elvis.angelaccio, lueck, sitter
Priority: NOR    
Version First Reported In: 1.21   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 17.12.3
Sentry Crash Report:
Attachments: Screenshot of bug
Patch which adds the separator

Description asl97 2017-06-09 19:01:39 UTC
Created attachment 106012 [details]
Screenshot of bug

Test case:
```
mkdir -p /tmp/bugs/this/is/a/test
echo test > /tmp/bugs/this/is/a/test/file # require due to https://bugs.kde.org/show_bug.cgi?id=381027
filelight /tmp/bugs/this/is/a/test
```
Then ether click the center or up till `/tmp/bugs`.

The file path `this/is/a/test/file` end up displaying as `thisisatestfile`

Clicking on it produce `Unable to run the command specified. The file or folder /tmp/bugs/thisisatestfile does not exist.`

Screenshot attached.
Comment 1 Burkhard Lück 2017-06-10 06:25:26 UTC
Ubuntu 16.10
$ filelight --version
filelight 1.21

filelight master build from sources
KDE Frameworks 5.35.0
Qt 5.7.0 (built against 5.7.0)

I can not reproduce this issue.
Comment 2 asl97 2017-06-10 09:45:04 UTC
I just build the current master from source f83358667ac611f8c8a2cd41097442dce1d5c711
And still able to produce the bug.

I don't see any related commit which could have fixed it nether.

I believe it's due to https://cgit.kde.org/filelight.git/tree/src/localLister.cpp?id=f83358667ac611f8c8a2cd41097442dce1d5c711#n215

Where `cwd->append(folder, new_dirname);` should instead be `cwd->append(folder,  new_dirname + '/');` like the line below.

Changing it as such fixed the bug for me.
Comment 3 asl97 2017-06-17 13:42:59 UTC
Created attachment 106142 [details]
Patch which adds the separator
Comment 4 Christoph Feck 2017-06-26 14:39:57 UTC
The current stable branch includes https://cgit.kde.org/filelight.git/commit/src?h=Applications/17.04&id=b06ec65e0c79d8eea8e44d4367364fd572c3dd19 which might have fixed the issue, but the commits in master might miss that.
Comment 5 Harald Sitter 2017-06-26 15:21:22 UTC
Seems to me that this commit is in master as well? Plus the commit is about the exclusion list (i.e. the blacklist of paths not to search), so I'd assume the bug at hand is simply a different incarnation of fileight's terribly inconsistent trailing slash handling.
Comment 6 Elvis Angelaccio 2018-02-26 22:10:15 UTC
Should be fixed by https://commits.kde.org/filelight/4f8d281aad8e8390fb8e6044da6a8bb0abb0195c