forked from OSchip/llvm-project
[libFuzzer] Make redirects happen in proper sequence.
"> file" must come before "2>&1" to have redirection occur correctly in all cases. Fixes a regression on minimize_two_crashes.test. llvm-svn: 319792
This commit is contained in:
parent
df6ba242bf
commit
056774d13b
|
@ -143,10 +143,10 @@ public:
|
|||
std::stringstream SS;
|
||||
for (auto arg : getArguments())
|
||||
SS << arg << " ";
|
||||
if (isOutAndErrCombined())
|
||||
SS << "2>&1 ";
|
||||
if (hasOutputFile())
|
||||
SS << ">" << getOutputFile() << " ";
|
||||
if (isOutAndErrCombined())
|
||||
SS << "2>&1 ";
|
||||
std::string result = SS.str();
|
||||
if (!result.empty())
|
||||
result = result.substr(0, result.length() - 1);
|
||||
|
|
|
@ -923,7 +923,7 @@ TEST(FuzzerCommand, SetOutput) {
|
|||
EXPECT_TRUE(Cmd.isOutAndErrCombined());
|
||||
|
||||
CmdLine = Cmd.toString();
|
||||
EXPECT_EQ(CmdLine, makeCmdLine("", "2>&1 >thud"));
|
||||
EXPECT_EQ(CmdLine, makeCmdLine("", ">thud 2>&1"));
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
|
Loading…
Reference in New Issue