Browse Source

* slight change to the OpenBSD startup code, to allow Low(__progname_storage)<>0
(not that it's going to be changed that way, but it doesn't hurt for the code
to be more robust; and it doesn't affect performance, since the compiler
optimizes x-0 to x)

git-svn-id: trunk@41737 -

nickysn 6 years ago
parent
commit
cf2aa6fdb7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      rtl/openbsd/x86_64/si_prc.inc

+ 1 - 1
rtl/openbsd/x86_64/si_prc.inc

@@ -53,7 +53,7 @@ procedure _FPC_proc___start(argc: LongInt; argv: PPChar; envp: Pointer; para1, p
         I:=Low(__progname_storage);
         I:=Low(__progname_storage);
         while (I<High(__progname_storage)) and (__progname[I]<>#0) do
         while (I<High(__progname_storage)) and (__progname[I]<>#0) do
           begin
           begin
-            __progname_storage[I]:=__progname[I];
+            __progname_storage[I]:=__progname[I-Low(__progname_storage)];
             Inc(I);
             Inc(I);
           end;
           end;
         __progname_storage[I]:=#0;
         __progname_storage[I]:=#0;