Description: ParamStr(0) should return abs path as on linux Bug-Dyson: http://osdyson.org/issues/178 Index: fpc/fpcsrc/rtl/solaris/system.pp =================================================================== --- fpc.orig/fpcsrc/rtl/solaris/system.pp 2014-07-05 08:42:27.480906242 +0400 +++ fpc/fpcsrc/rtl/solaris/system.pp 2014-07-07 21:39:54.477572186 +0400 @@ -106,11 +106,11 @@ begin { stricly conforming POSIX applications } { have the executing filename as argv[0] } -// if l=0 then -// begin -// paramstr := execpathstr; -// end -// else + if l=0 then + begin + paramstr := execpathstr; + end + else if (l < argc) then paramstr:=strpas(argv[l]) else @@ -184,6 +184,16 @@ FpSigAction(SIGILL,@oldsigill,nil); end; +procedure SysInitExecPath; +var + i : longint; +begin + execpathstr[0]:=#0; + i:=Fpreadlink('/proc/self/path/a.out',@execpathstr[1],high(execpathstr)); + if (i>0) and (execpathstr[1]='/') then + execpathstr[0]:=char(i); +end; + procedure SetupCmdLine; var @@ -283,6 +293,7 @@ { Reset IO Error } InOutRes:=0; { Arguments } + SysInitExecPath; SetupCmdLine; InitSystemThreads; initvariantmanager;