* support {$i *.ext} to include source files with the same base name, but

with a different extension than the current source file (mantis #13696)

git-svn-id: trunk@13163 -
This commit is contained in:
Jonas Maebe 2009-05-17 14:33:20 +00:00
parent 9a0808d0fb
commit b59d1f724b
4 changed files with 18 additions and 0 deletions

2
.gitattributes vendored
View File

@ -8866,6 +8866,8 @@ tests/webtbs/tw13628b.pp svneol=native#text/plain
tests/webtbs/tw13639.pp svneol=native#text/plain
tests/webtbs/tw1364.pp svneol=native#text/plain
tests/webtbs/tw1365.pp svneol=native#text/plain
tests/webtbs/tw13696.inc svneol=native#text/plain
tests/webtbs/tw13696.pp svneol=native#text/plain
tests/webtbs/tw1374.pp svneol=native#text/plain
tests/webtbs/tw1375.pp svneol=native#text/plain
tests/webtbs/tw1376.pp svneol=native#text/plain

View File

@ -1682,6 +1682,12 @@ In case not, the value returned can be arbitrary.
hs:=FixFileName(hs);
path:=ExtractFilePath(hs);
name:=ExtractFileName(hs);
{ Special case for Delphi compatibility: '*' has to be replaced
by the file name of the current source file. }
if (length(name)>=1) and
(name[1]='*') then
name:=ChangeFileExt(current_module.sourcefiles.get_file_name(current_filepos.fileindex),'')+ExtractFileExt(name);
{ try to find the file }
found:=findincludefile(path,name,foundfile);
if (ExtractFileExt(name)='') then

3
tests/webtbs/tw13696.inc Normal file
View File

@ -0,0 +1,3 @@
procedure test;
begin
end;

7
tests/webtbs/tw13696.pp Normal file
View File

@ -0,0 +1,7 @@
{ %norun }
{$i *.inc}
begin
test;
end.