mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Teach Path::GetCurrentDirectory to use $PWD, to support users who like to do
screwy things by setting PWD != getcwd(). For example, some developers I know will use this to control the value in gcc's DW_AT_comp_dir value in debug output. With this patch, that trick will now work on clang too. The only other effect of this change is that the static analysis will now respect $PWD when reporting the directory of the files in its HTML output. I think that's fine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3bbb6f79b7
commit
3c036e520e
@ -251,9 +251,12 @@ Path::GetUserHomeDirectory() {
|
||||
|
||||
Path
|
||||
Path::GetCurrentDirectory() {
|
||||
if (char *pwd = getenv("PWD"))
|
||||
return Path(pwd);
|
||||
|
||||
char pathname[MAXPATHLEN];
|
||||
if (!getcwd(pathname,MAXPATHLEN)) {
|
||||
assert (false && "Could not query current working directory.");
|
||||
if (!getcwd(pathname, MAXPATHLEN)) {
|
||||
assert(false && "Could not query current working directory.");
|
||||
return Path();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user