diff --git a/fstrm/file.c b/fstrm/file.c index 5a17c0957..6c6d11dc6 100644 --- a/fstrm/file.c +++ b/fstrm/file.c @@ -55,7 +55,10 @@ fstrm__file_op_open(void *obj) { struct fstrm__file *f = obj; if (f->fp == NULL && f->file_path != NULL) { - f->fp = fopen(f->file_path, f->file_mode); + if (!strcmp(f->file_path, "-")) + f->fp = f->file_mode[0] == 'r' ? stdin : stdout; + else + f->fp = fopen(f->file_path, f->file_mode); if (f->fp == NULL) return fstrm_res_failure; return fstrm_res_success;