Skip to content

Commit

Permalink
Fix automatic identification of CIF files. (#1080)
Browse files Browse the repository at this point in the history
* Fix automatic ID of CIF files

* Revision bump for CIF id fix
  • Loading branch information
drroe authored May 14, 2024
1 parent e043c39 commit 00e32c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 00e32c7

Please sign in to comment.