fix absolute_file_name with empty arguments.

This commit is contained in:
Vítor Santos Costa 2012-11-25 23:35:59 +00:00
parent d5b97ac15e
commit feb70d0146

View File

@ -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)).