This is an archive of the discontinued LLVM Phabricator instance.

FileSpec: Fix PrependPathComponent("/")
ClosedPublic

Authored by labath on Jan 13 2017, 6:19 AM.

Details

Summary

PrependPathComponent was unconditionally inserting path separators between the
path components. This is not correct if the prepended path is "/", which caused
problems down the line. Fix the function to use the same algorithm as
AppendPathComponent and add a test. This fixes one part of llvm.org/pr31611.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 84294.Jan 13 2017, 6:19 AM
labath retitled this revision from to FileSpec: Fix PrependPathComponent("/").
labath updated this object.
labath added reviewers: clayborg, zturner.
labath added a subscriber: lldb-commits.
clayborg accepted this revision.Jan 13 2017, 1:26 PM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Jan 13 2017, 1:26 PM
This revision was automatically updated to reflect the committed changes.