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

Fix automatic identification of CIF files. #1080

Merged
merged 2 commits into from
May 14, 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
5 changes: 4 additions & 1 deletion src/CIFfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,17 @@ bool CIFfile::ID_CIF(CpptrajFile& fileIn) {
int ndata = 0; // Number of '_XXX' entries seen
bool foundLoop = false;
bool foundEntryID = false;
bool foundDataBlock = false;
for (int i = 0; i < 10; i++) {
std::string lineIn = fileIn.GetLine();
if (lineIn[0] == '_') ndata++;
if (lineIn.compare(0,5,"data_")==0) foundDataBlock = true;
if (lineIn.compare(0,5,"loop_")==0) foundLoop = true;
if (lineIn.compare(0,9,"_entry.id")==0) foundEntryID = true;
}
fileIn.CloseFile();
return ( ndata > 2 && (foundLoop || foundEntryID) );
if (foundDataBlock || foundLoop || foundEntryID) return true;
return ( ndata > 2 && (foundLoop || foundEntryID || foundDataBlock) );
}

// CIFfile::Read()
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.25.2"
#define CPPTRAJ_INTERNAL_VERSION "V6.25.3"
/// PYTRAJ relies on this
#define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION
#endif
Loading