* patch for 4095

git-svn-id: trunk@895 -
This commit is contained in:
marco 2005-08-16 12:13:28 +00:00
parent 7196302522
commit a234180e3a

View File

@ -1063,11 +1063,15 @@ implementation
function findincludefile(const path,name,ext:string;var foundfile:string):boolean; function findincludefile(const path,name,ext:string;var foundfile:string):boolean;
var var
found : boolean; found : boolean;
hpath : string; hpath : string;
begin begin
{ look for the include file { look for the include file
1. specified path,path of current inputfile,current dir If path was specified as part of {$I } then
1. specified path (expanded with path of inputfile if relative)
else
1. path of current inputfile,current dir
2. local includepath 2. local includepath
3. global includepath } 3. global includepath }
found:=false; found:=false;
@ -1078,15 +1082,18 @@ implementation
if not path_absolute(path) then if not path_absolute(path) then
hpath:=current_scanner.inputfile.path^+path hpath:=current_scanner.inputfile.path^+path
else else
hpath:=path+';'+current_scanner.inputfile.path^; hpath:=path;
found:=FindFile(name+ext, hpath,foundfile);
end end
else else
hpath:=current_scanner.inputfile.path^; begin
found:=FindFile(name+ext, hpath+';'+CurDirRelPath(source_info),foundfile); hpath:=current_scanner.inputfile.path^+';'+CurDirRelPath(source_info);
if (not found) then found:=FindFile(name+ext, hpath,foundfile);
found:=current_module.localincludesearchpath.FindFile(name+ext,foundfile); if not found then
if (not found) then found:=current_module.localincludesearchpath.FindFile(name+ext,foundfile);
found:=includesearchpath.FindFile(name+ext,foundfile); if not found then
found:=includesearchpath.FindFile(name+ext,foundfile);
end;
findincludefile:=found; findincludefile:=found;
end; end;
@ -1176,7 +1183,9 @@ implementation
hp:=do_openinputfile(foundfile); hp:=do_openinputfile(foundfile);
current_scanner.addfile(hp); current_scanner.addfile(hp);
current_module.sourcefiles.register_file(hp); current_module.sourcefiles.register_file(hp);
if not current_scanner.openinputfile then if (not found) then
Message1(scan_f_cannot_open_includefile,hs);
if (not current_scanner.openinputfile) then
Message1(scan_f_cannot_open_includefile,hs); Message1(scan_f_cannot_open_includefile,hs);
Message1(scan_t_start_include_file,current_scanner.inputfile.path^+current_scanner.inputfile.name^); Message1(scan_t_start_include_file,current_scanner.inputfile.path^+current_scanner.inputfile.name^);
current_scanner.reload; current_scanner.reload;