diff --git a/src/frontend/runcoms.c b/src/frontend/runcoms.c index 59a4ea297..16456d351 100644 --- a/src/frontend/runcoms.c +++ b/src/frontend/runcoms.c @@ -282,6 +282,7 @@ dosim( /*---------------------------------------------------------------------------*/ #else else if (!(rawfileFp = fopen(wl->wl_word, "w"))) { + rawfileFp = stdout; /* If fopen has failed, we have to proceed with stdout */ setvbuf(rawfileFp, rawfileBuf, _IOFBF, RAWBUF_SIZE); perror(wl->wl_word); ft_setflag = FALSE; diff --git a/src/frontend/runcoms2.c b/src/frontend/runcoms2.c index e3cc196e4..3d42df443 100644 --- a/src/frontend/runcoms2.c +++ b/src/frontend/runcoms2.c @@ -126,6 +126,7 @@ com_resume(wordlist *wl) /*---------------------------------------------------------------------------*/ #else else if (!(rawfileFp = fopen(last_used_rawfile, "a"))) { + rawfileFp = stdout; /* If fopen has failed, we have to proceed with stdout */ setvbuf(rawfileFp, rawfileBuf, _IOFBF, RAWBUF_SIZE); perror(last_used_rawfile); ft_setflag = FALSE;