[fpc-pascal] Search path order for fpc.cfg

fredvs fiens at hotmail.com
Sun Apr 12 13:30:13 CEST 2020


> committed in rev. 44697

Yep, excellent!

> Note that this still may cause surprises, because paramstr(0) is not 100%
reliable.

Hum, ok, but I assume to take the risk.
Finally, the worst that can happen is fail to compil.

Nice, FPC is nearly OOTB now.
Only miss a very, very little patches: the "so.n" of course and the
searchpath order.

I feel that "so.n" patch has a possibility to be apply, I dont feel so much
hostility about it.

So I keep my force for the last combat, the "searchpath order":
compiler/option.pas line 3349 

function check_configfile(fn:string; var foundfn:string):boolean;
 
  if not FileExists(fn) then // current dir
    if
CfgFileExists(IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))+fn)
then // add this:
       foundfn:=IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))+fn //
dir of compiler
    else 

Just convince that placing a config file in the same directory than then
compiler is not a crime in Unix.

And prove that directory of compiler has to be in second position for
searching.
And that it will not break any compatibility, even for Windows.

OK, I am ready for the combat, I am sure of my arguments.

Fre;D







--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/


More information about the fpc-pascal mailing list