From feb70d01466f4ba65fcea4e1f70a561a4fe81303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 25 Nov 2012 23:35:59 +0000 Subject: [PATCH] fix absolute_file_name with empty arguments. --- pl/consult.yap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pl/consult.yap b/pl/consult.yap index a8825ede8..6d4fd5440 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -649,8 +649,10 @@ absolute_file_name(File0,File) :- '$full_filename'(F0,F,G) :- '$absolute_file_name'(F0,[access(read),file_type(source),file_errors(fail),solutions(first),expand(true)],F,G). +% fix wrong argument order, TrueFileName should be last. absolute_file_name(File,TrueFileName,Opts) :- - ( var(TrueFileName) ; atom(TrueFileName) ), !, + ( var(TrueFileName) -> true ; atom(TrueFileName), TrueFileName \= [] ), + !, absolute_file_name(File,Opts,TrueFileName). absolute_file_name(File,Opts,TrueFileName) :- '$absolute_file_name'(File,Opts,TrueFileName,absolute_file_name(File,Opts,TrueFileName)).