summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/dyson-execpathstr.patch48
-rw-r--r--debian/patches/series1
3 files changed, 56 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 7454e569..827479c5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+fpc (2.6.4+dfsg-3~dyson2) unstable; urgency=medium
+
+ * Added dyson-execpathstr.patch:
+ paramstr(0) should return abs path as on linux
+
+ -- Igor Pashev <pashev.igor@gmail.com> Mon, 07 Jul 2014 21:51:08 +0400
+
fpc (2.6.4+dfsg-3~dyson1) unstable; urgency=low
[ Abou Al Montacir ]
diff --git a/debian/patches/dyson-execpathstr.patch b/debian/patches/dyson-execpathstr.patch
new file mode 100644
index 00000000..843f1cbb
--- /dev/null
+++ b/debian/patches/dyson-execpathstr.patch
@@ -0,0 +1,48 @@
+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;
diff --git a/debian/patches/series b/debian/patches/series
index dab4317e..646274a9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,3 +20,4 @@ dyson-solaris-gnutoolchain.patch
dyson-libs.patch
dyson-components.patch
dyson-fpcmake.ini.patch
+dyson-execpathstr.patch