forked from OSchip/llvm-project
Fix "file ./a.out" and file "../a.out" so that is works after recent FileSpec normalization path changes.
Test coming soon, but I want to unbreak people. llvm-svn: 331637
This commit is contained in:
parent
f9b3fc5e2b
commit
d68dbd5ad6
|
@ -367,16 +367,12 @@ Status TargetList::CreateTargetInternal(Debugger &debugger,
|
|||
user_exe_path_is_bundle = true;
|
||||
|
||||
if (file.IsRelative() && !user_exe_path.empty()) {
|
||||
// Ignore paths that start with "./" and "../"
|
||||
if (!user_exe_path.startswith("./") && !user_exe_path.startswith("../")) {
|
||||
llvm::SmallString<64> cwd;
|
||||
if (! llvm::sys::fs::current_path(cwd)) {
|
||||
cwd += '/';
|
||||
cwd += user_exe_path;
|
||||
FileSpec cwd_file(cwd, false);
|
||||
if (cwd_file.Exists())
|
||||
file = cwd_file;
|
||||
}
|
||||
llvm::SmallString<64> cwd;
|
||||
if (! llvm::sys::fs::current_path(cwd)) {
|
||||
FileSpec cwd_file(cwd.c_str(), false);
|
||||
cwd_file.AppendPathComponent(file);
|
||||
if (cwd_file.Exists())
|
||||
file = cwd_file;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue