diff --git a/.gitattributes b/.gitattributes index 53bd910008..f236be4e46 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/scanner.pas b/compiler/scanner.pas index d6db1a4ec8..9bf9b8322e 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -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 diff --git a/tests/webtbs/tw13696.inc b/tests/webtbs/tw13696.inc new file mode 100644 index 0000000000..c5e9aa0ec3 --- /dev/null +++ b/tests/webtbs/tw13696.inc @@ -0,0 +1,3 @@ +procedure test; +begin +end; diff --git a/tests/webtbs/tw13696.pp b/tests/webtbs/tw13696.pp new file mode 100644 index 0000000000..39c2aa35ae --- /dev/null +++ b/tests/webtbs/tw13696.pp @@ -0,0 +1,7 @@ +{ %norun } + +{$i *.inc} + +begin + test; +end.