Emit an error message if the current working directory does not exist when the user is trying to launch argdumper to do shell expansion

llvm-svn: 251882
This commit is contained in:
Enrico Granata 2015-11-03 01:47:19 +00:00
parent 3181c2ef72
commit c0d8f0ca7d
1 changed files with 7 additions and 1 deletions

View File

@ -1371,7 +1371,13 @@ Host::ShellExpandArguments (ProcessLaunchInfo &launch_info)
int status;
std::string output;
RunShellCommand(expand_command, launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10);
FileSpec cwd(launch_info.GetWorkingDirectory());
if (!cwd.Exists())
{
error.SetErrorStringWithFormat("cwd does not exist; cannot launch with shell argument expansion");
return error;
}
RunShellCommand(expand_command, cwd, &status, nullptr, &output, 10);
if (status != 0)
{