Improve the detection of the path
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 9 Dec 2013 16:27:00 +0000 (16:27 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 9 Dec 2013 16:27:00 +0000 (16:27 +0000)
commit1a803295d08f1d562b4cebcb830edd874ec16d79
treef651a1bd0495efbd1d3d316fe2c5c977d28ad7c6
parent68138dc9a89cda52bdc7d27bbebec194809e93cf
Improve the detection of the path

Summary:
When clang is used under GNU/Linux in a chroot without /proc mount, it falls
back on the BSD method. However, since the buf variable is used twice
and fails with snprintf to produce the correct path.

When called as relatived (ie ./clang), it was failing with:
 "" -cc1 [...] -x c++ x.cc
error: unable to execute command: Executable "" doesn't exist!

I also took the opportunity to simply the code (the first arg of test_dir
was useless).

Reviewers: rafael

Reviewed By: rafael

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2361

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196791 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Unix/Path.inc