Disallow ascii formats for gmx trjcat
authorErik Lindahl <erik@kth.se>
Tue, 12 Dec 2017 00:15:00 +0000 (01:15 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 12 Dec 2017 18:32:38 +0000 (19:32 +0100)
Since trjcat (deliberately) does not use any TPR file,
the tool can't handle trajectory formats such as GRO
or PDB where atom/residue names are needed.

Fixes #2225.

Change-Id: I55cbfd5f8a3909c1f76e63fa402f0c3243a6f7c7

src/gromacs/gmxana/gmx_trjcat.cpp

index 950c87fee7e88a9d2fd23eb36660fef4aa3ac27e..1b41ebb3c5e1c8ff5f02b960ead5ee1cbe53d3b3 100644 (file)
@@ -560,11 +560,16 @@ int gmx_trjcat(int argc, char *argv[])
 
     ftpin = fn2ftp(fnms[0]);
 
+    if (ftpin != efTRR && ftpin != efXTC && ftpin != efTNG)
+    {
+        gmx_fatal(FARGS, "gmx trjcat can only handle binary trajectory formats (trr, xtc, tng)");
+    }
+
     for (i = 1; i < nfile_in; i++)
     {
         if (ftpin != fn2ftp(fnms[i]))
         {
-            gmx_fatal(FARGS, "All input files must be of the same format");
+            gmx_fatal(FARGS, "All input files must be of the same (trr, xtc or tng) format");
         }
     }