]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
With help from Axel -- work around a CINT bug with destruction of string temporary.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Aug 2010 14:36:17 +0000 (14:36 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Aug 2010 14:36:17 +0000 (14:36 +0000)
EVE/macros/alieve_init.C

index deb3122358d8857e5982f4ce60115f601861fae9..7ddb527a470fc3e23a1c4b80d49c5f59802b8cab 100644 (file)
@@ -87,19 +87,15 @@ void alieve_init_import_macros()
     std::list<string> names; // This form understood by cint (fails with std::string).
     while ((filename = gSystem->GetDirEntry(dirhandle)) != 0)
     {
+      std::string sFilename(filename);
       if (re.Match(filename))
-       names.push_back(filename);
+       names.push_back(sFilename);
     }
     names.sort();
-    //PH The line below is replaced waiting for a fix in Root
-    //PH which permits to use variable siza arguments in CINT
-    //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
-    // f->Add(new TEveMacro(Form("%s/%s", macdir.Data(), filename)));
-    char fullName[1000];
+
     for (std::list<string>::iterator si=names.begin(); si!=names.end(); ++si)
     {
-      sprintf(fullName,"%s/%s", macdir.Data(), si->c_str());
-      f->Add(new TEveMacro(fullName));
+      f->Add(new TEveMacro(Form("%s/%s", macdir.Data(), si->c_str())));
     }
   }
   gSystem->FreeDirectory(dirhandle);