KConfig: fix double slash when an env var ends with a slash.
AbandonedPublic

Authored by dfaure on Dec 2 2017, 9:04 AM.

Details

Reviewers
mdawson
apol
mpyne
Summary

The CI has $HOME=/home/jenkins/ with a trailing slash, which leads to
FAIL! : KConfigTest::testPath() Compared values are not the same

Actual   (sc3.readPathEntry("homepath", QString())): "/home/jenkins//foo"
Expected (HOMEPATH): "/home/jenkins/foo"

The fix is to also replace the '/' in "$HOME/", when the env var ends
with '/' and there is indeed a '/' after the env var in the source
string.

Test Plan

kconfigtest now passes with HOME=/home/dfaure/, and the newly
added unittest passes.

Diff Detail

Repository
R237 KConfig
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Dec 2 2017, 9:04 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 2 2017, 9:04 AM
dfaure requested review of this revision.Dec 2 2017, 9:04 AM
dfaure abandoned this revision.Dec 2 2017, 9:15 AM

Well, on second thought, $HOME/foo leads to double slash in a shell (when HOME has trailing slash), so the bug isn't kconfig but the expected value (QDir::homePath() returns a cleaned up value).