From 86b5080dee86d70b3406864d0251059dc0dd26a0 Mon Sep 17 00:00:00 2001
From: Andreas Suter <andreas.suter@psi.ch>
Date: Wed, 29 Jan 2025 08:04:48 +0100
Subject: [PATCH] proper handling of comments and descriptions in the RUN
 block.

---
 src/classes/PMsrHandler.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp
index 30686720..6d2bcce4 100644
--- a/src/classes/PMsrHandler.cpp
+++ b/src/classes/PMsrHandler.cpp
@@ -3244,7 +3244,10 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
   while ((iter != lines.end()) && !error) {
     // remove potential comment at the end of lines
     str = iter->fLine;
-    Ssiz_t idx = str.Index("(");
+    Ssiz_t idx = str.Index("#");
+    if (idx != -1)
+      str.Remove(idx);
+    idx = str.Index("(");
     if (idx != -1)
       str.Remove(idx);
 
-- 
GitLab