From 38a62486cac77eff28f09e430a42fa20a0516b84 Mon Sep 17 00:00:00 2001 From: rbishnu <120459077+bishnu-pR@users.noreply.github.com> Date: Tue, 5 May 2026 16:09:45 -0400 Subject: [PATCH 1/2] Refactor input line parsing to remove empty tokens in GEOM file --- examples/lih_VK1/GEOM | 4 ++-- src/libio/read.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/lih_VK1/GEOM b/examples/lih_VK1/GEOM index 7d9c96e..878ab59 100644 --- a/examples/lih_VK1/GEOM +++ b/examples/lih_VK1/GEOM @@ -1,2 +1,2 @@ -Li 0. 0. -1.5 -H 0. 0. 1.5 +Li 0. 0. -1.5 +H 0. 0. 1.5 diff --git a/src/libio/read.cpp b/src/libio/read.cpp index fd99842..a937217 100644 --- a/src/libio/read.cpp +++ b/src/libio/read.cpp @@ -2547,7 +2547,12 @@ int read_input(string filename, bool gbasis, vector >& basis, vec while (!infile.eof()) { (bool)getline(infile, line); - vector tok_line = split1(line,' '); + //vector tok_line = split1(line,' '); + + vector tok_line_raw = split1(line, ' '); + vector tok_line; + for (const string& t : tok_line_raw) + if (!t.empty()) tok_line.push_back(t); //cout << " 2READ: " << line << endl; if (tok_line.size()>3) From 8b41befb582bfe6050b472cb44694215d90a5251 Mon Sep 17 00:00:00 2001 From: bishnu-pR <120459077+bishnu-pR@users.noreply.github.com> Date: Tue, 5 May 2026 21:28:11 +0000 Subject: [PATCH 2/2] Clean up read_input GEOM parsing fix Remove dead commented-out split1 line and align indentation with surrounding 2-space style. Co-Authored-By: Claude Opus 4.7 --- src/libio/read.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libio/read.cpp b/src/libio/read.cpp index a937217..1e0e456 100644 --- a/src/libio/read.cpp +++ b/src/libio/read.cpp @@ -2547,12 +2547,10 @@ int read_input(string filename, bool gbasis, vector >& basis, vec while (!infile.eof()) { (bool)getline(infile, line); - //vector tok_line = split1(line,' '); - vector tok_line_raw = split1(line, ' '); vector tok_line; for (const string& t : tok_line_raw) - if (!t.empty()) tok_line.push_back(t); + if (!t.empty()) tok_line.push_back(t); //cout << " 2READ: " << line << endl; if (tok_line.size()>3)