diff options
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/stream.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index ba49ebb0..d374a3d3 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -1598,6 +1598,7 @@ void write_geometry_file(Stream *st, const char *geom_filename) { char line[2014]; FILE *geom_fh; char *rval; + int eol; if ( geom_filename == NULL ) return; @@ -1612,8 +1613,14 @@ void write_geometry_file(Stream *st, const char *geom_filename) { do { rval = fgets(line, 1023, geom_fh); if ( rval != NULL ) fputs(line, st->fh); + eol = ( line[strlen(line)-1] == '\n' ); } while ( rval != NULL ); + + if ( !eol ) { + fprintf(st->fh, "\n"); + } + fclose(geom_fh); fprintf(st->fh, GEOM_END_MARKER"\n"); |