Skip to content

Commit

Permalink
Handle blank lines at the end of Karplus data file for jcoupling acti…
Browse files Browse the repository at this point in the history
…on (#1088)

* Handle blank lines at the end of Karplus data file

* 6.27.1. Handle empty lines at the end of Karplus data file for jcoupling
action
  • Loading branch information
drroe authored Jun 27, 2024
1 parent 44dba30 commit 052878b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/Action_Jcoupling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ int Action_Jcoupling::loadKarplus(std::string const& filename) {
if (buffer == 0) return fileEOF(filename);
while (buffer != 0) {
// Skip empty lines (BufferedLine.Line() removes newlines) and comments
while (buffer[0]=='\0' || buffer[0]=='#')
while (buffer[0]=='\0' || buffer[0]=='#') {
buffer = KarplusFile.Line();
if (buffer == 0) return fileEOF(filename);
if (buffer == 0) {
if (JcoupleData_.empty())
return fileEOF(filename);
else
break;
}
}
if (buffer == 0) break;
const char* ptr = buffer;
// First char is optional type. If optional type is C, then the Karplus
// function specified in Perez et al. JACS (2001) 123 will be used, and
Expand Down
2 changes: 1 addition & 1 deletion src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Whenever a number that precedes <revision> is incremented, all subsequent
* numbers should be reset to 0.
*/
#define CPPTRAJ_INTERNAL_VERSION "V6.27.0"
#define CPPTRAJ_INTERNAL_VERSION "V6.27.1"
/// PYTRAJ relies on this
#define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION
#endif

0 comments on commit 052878b

Please sign in to comment.