From 59db4e68a3fda45bd801a3c2f7ffa6daaa6ca1ea Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Fri, 14 Mar 2025 13:26:31 +0100
Subject: [PATCH] Fix geant4 config script

Depending on an environment variable it can happen that a path contains a //.
In such a case the excution of the specified macro fails which is now fixed.
---
 sim/transport/gconfig/g4Config.C | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sim/transport/gconfig/g4Config.C b/sim/transport/gconfig/g4Config.C
index aad1a727f0..0ba3c7eb3c 100644
--- a/sim/transport/gconfig/g4Config.C
+++ b/sim/transport/gconfig/g4Config.C
@@ -52,10 +52,12 @@ void Config()
 
   TString configm(gSystem->Getenv("CONFIG_DIR"));
   TString configm1 = configm + "/g4config.in";
+  configm1.ReplaceAll("//", "/");
   cout << " -I g4Config() using g4conf  macro: " << configm1 << endl;
 
   // set the common cuts
   TString cuts = configm + "/SetCuts.C";
+  cuts.ReplaceAll("//", "/");
   cout << "Physics cuts with script \n " << cuts.Data() << endl;
   Int_t cut = gROOT->LoadMacro(cuts.Data());
   if (cut == 0) gInterpreter->ProcessLine("SetCuts()");
-- 
GitLab