Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle blank lines at the end of Karplus data file for jcoupling action #1088

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading