aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/stream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 91b1fb9e..8586c850 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1264,7 +1264,12 @@ Stream *open_stream_for_read(const char *filename)
st = malloc(sizeof(struct _stream));
if ( st == NULL ) return NULL;
- st->fh = fopen(filename, "r");
+ if ( strcmp(filename, "-") == 0 ) {
+ st->fh = stdin;
+ } else {
+ st->fh = fopen(filename, "r");
+ }
+
if ( st->fh == NULL ) {
free(st);
return NULL;