Fix trjconv -split not closing files
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 6 Oct 2014 17:48:43 +0000 (19:48 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 6 Oct 2014 17:48:43 +0000 (19:48 +0200)
With long trajectories, the number of file handles will run out.

Change-Id: I9f6e20ddb836250431460ff6ed918ec74f2699ee

src/gromacs/gmxana/gmx_trjconv.c

index 516bd4050f766b8ab4c9baf2985f6bcefe06b2c4..984c8cc078e5a1d68fdd4c11a2484ec927f7355d 100644 (file)
@@ -1852,7 +1852,7 @@ int gmx_trjconv(int argc, char *argv[])
                                         }
                                         write_g96_conf(out, &frout, -1, NULL);
                                 }
-                                if (bSeparate)
+                                if (bSeparate || bSplitHere)
                                 {
                                     gmx_ffclose(out);
                                     out = NULL;