Skip to content
Snippets Groups Projects
Commit fe482d20 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

this patch prevents creation of meaningless histograms in case of a typo in a

variable name. By Philippe.


git-svn-id: http://root.cern.ch/svn/root/trunk@4429 27541ba8-7e3a-0410-8455-c3a389f83636
parent f31bad48
No related branches found
No related tags found
No related merge requests found
// @(#)root/treeplayer:$Name: $:$Id: TTreeFormula.cxx,v 1.91 2002/04/22 19:02:33 brun Exp $
// @(#)root/treeplayer:$Name: $:$Id: TTreeFormula.cxx,v 1.92 2002/04/24 16:50:12 rdm Exp $
// Author: Rene Brun 19/01/96
/*************************************************************************
......@@ -2033,6 +2033,7 @@ Int_t TTreeFormula::DefinedVariable(TString &name)
}
leafinfo = 0;
current = &(work[0]);
*current = 0;
continue;
} else if (right[i] == ')') {
// We should have the end of a cast operator. Let's introduce a TFormLeafCast
......@@ -2053,6 +2054,7 @@ Int_t TTreeFormula::DefinedVariable(TString &name)
}
leafinfo = 0;
current = &(work[0]);
*current = 0;
cl = casted;
continue;
......@@ -2210,6 +2212,7 @@ Int_t TTreeFormula::DefinedVariable(TString &name)
cl = element->GetClassPointer();
}
current = &(work[0]);
*current = 0;
if (right[i] == '[') {
int bracket = i;
......@@ -2238,6 +2241,11 @@ Int_t TTreeFormula::DefinedVariable(TString &name)
}
}
if (strlen(work)!=0) {
// We have something left to analyze. Let's make this an error case!
return -1;
}
// Let see if we can understand the structure of this branch.
// Usually we have: leafname[fixed_array] leaftitle[var_array]\type
// (with fixed_array that can be a multi-dimension array.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment