Require ">" after ".5" to accept it as redirection (ROOT-8696).

This commit is contained in:
Axel Naumann 2017-03-22 20:58:08 +01:00 committed by sftnight
parent de56970ff0
commit 7c1fbfcf9f
2 changed files with 4 additions and 1 deletions

View File

@ -185,7 +185,7 @@ namespace cling {
// Default redirect is stdout.
MetaProcessor::RedirectionScope stream = MetaProcessor::kSTDOUT;
if (getCurTok().is(tok::constant)) {
if (getCurTok().is(tok::constant) && lookAhead(1).is(tok::greater)) {
// > or 1> the redirection is for stdout stream
// 2> redirection for stderr stream
constant_FD = getCurTok().getConstant();

View File

@ -19,6 +19,9 @@ static void setup() {
}
setup();
// ROOT-8696
.5 //CHECKOUT: (double) 0.500000
.2>&1
std::cerr << "Error into stdout.\n";
//CHECKOUT: Error into stdout.