diff --git a/C/iopreds.c b/C/iopreds.c
index 851bd9d30..0ccf89d0f 100644
--- a/C/iopreds.c
+++ b/C/iopreds.c
@@ -1977,6 +1977,7 @@ p_open_pipe_stream (void)
sno = GetFreeStreamD();
if (sno < 0)
return (PlIOError (SYSTEM_ERROR,TermNil, "new stream not available for open_pipe_stream/2"));
+ t1 = MkStream (sno);
st = &Stream[sno];
st->status = Input_Stream_f | Pipe_Stream_f;
st->linepos = 0;
@@ -1996,7 +1997,6 @@ p_open_pipe_stream (void)
sno = GetFreeStreamD();
if (sno < 0)
return (PlIOError (SYSTEM_ERROR,TermNil, "new stream not available for open_pipe_stream/2"));
- t1 = MkStream (sno);
st = &Stream[sno];
st->status = Output_Stream_f | Pipe_Stream_f;
st->linepos = 0;
@@ -3272,7 +3272,7 @@ p_file_name (void)
tout = MkAtomTerm(Yap_LookupAtom("charsio"));
else
tout = MkAtomTerm(Stream[sno].u.file.name);
- return (Yap_unify_constant (ARG2, tout));
+ return Yap_unify_constant (ARG2, tout);
}
static Int
diff --git a/changes-5.1.html b/changes-5.1.html
index 903f2f460..ee78215c9 100644
--- a/changes-5.1.html
+++ b/changes-5.1.html
@@ -16,6 +16,8 @@
Yap-5.1.0:
+- FIXED: pipe open was returning the same descriptor twice (Christian Thaeter).
+- FIXED: style check should compare with true file name.
- FIXED: ^c should take care about TR and B.
- FIXED: don't pass a pointer to a mpz_t. (Nuno Fonseca)
- FIXED: handle heap overflow from huge atoms in Yap_LookupAtom/scanner (Nuno Fonseca).
diff --git a/pl/consult.yap b/pl/consult.yap
index b2904a98d..00e93acaa 100644
--- a/pl/consult.yap
+++ b/pl/consult.yap
@@ -192,7 +192,7 @@ use_module(M,F,Is) :-
'$consult_infolevel'(InfLevel),
recorda('$initialisation','$',_),
( Reconsult = reconsult ->
- '$start_reconsulting'(F),
+ '$start_reconsulting'(File),
'$start_consult'(Reconsult,File,LC),
'$remove_multifile_clauses'(File),
StartMsg = reconsulting,
@@ -284,14 +284,7 @@ use_module(M,F,Is) :-
;
Opts=[silent(true)]
),
- ( '$find_in_path'(X,Y,reconsult(X)),
- '$open'(Y,'$csult',Stream,0) ->
- ( '$access_yap_flags'(15, 0) -> true ; '$skip_unix_comments'(Stream) ),
- load_files(Y,[stream(Stream)|Opts])
- ;
- '$output_error_message'(permission_error(input,stream,X),reconsult(X))
- ),
-
+ load_files(X, Opts),
( '$access_yap_flags'(15, 0) -> true ; halt).
'$skip_unix_comments'(Stream) :-