Handle folders matching substrings of included/excluded folders correctly
ClosedPublic

Authored by bruns on Feb 7 2019, 8:18 PM.

Details

Summary

FileIndexerConfig::shouldFolderBeIndexe(...) calls folderInList to
determine if the config should be included or excluded.

For a config:
[0] include: <HOME>/foo
[1] exclude: <HOME>/foo/bar

the folder "<HOME>/foo/barbaz" would be erroneously excluded, as
folders[1].startsWith(folder) is true, i.e. the exclude entry would be
used, although folders[0] is the correct match (folders are matched back
to front).

This can be avoided by normalizing the config entries to always end
with a trailing slash.

For the config itself this had been handled explicitly, but is no longer
needed.

Depends on D18829

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Feb 7 2019, 8:18 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptFeb 7 2019, 8:18 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Feb 7 2019, 8:18 PM
ngraham accepted this revision.Feb 8 2019, 8:37 PM
This revision is now accepted and ready to land.Feb 8 2019, 8:37 PM
This revision was automatically updated to reflect the committed changes.