Skip to content
Snippets Groups Projects
Commit 0b8a485b authored by Rene Brun's avatar Rene Brun
Browse files

From Mattias Helert:

fix a problem when executing $ROOTSYS/tutorials/hist/hbars.C from a user directory 
see https://savannah.cern.ch/bugs/index.php?72046


git-svn-id: http://root.cern.ch/svn/root/trunk@35065 27541ba8-7e3a-0410-8455-c3a389f83636
parent e7be9a73
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ TFile *cernbuild(Int_t get=0) {
//The input file cern.dat is a copy of the CERN staff data base
//from 1988
TString filename = "cernstaff.root";
TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
dir.ReplaceAll("cernbuild.C","");
dir.ReplaceAll("/./","/");
......@@ -70,7 +71,11 @@ TFile *cernbuild(Int_t get=0) {
tree->Write();
fclose(fp);
if (get) return hfile;
delete hfile;
if (get) {
//we come here when the script is executed outside $ROOTSYS/tutorials/tree
hfile = TFile::Open(filename);
return hfile;
}
return 0;
}
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