Browse Source

+ Fix for command-line property

michael 21 years ago
parent
commit
973bf7028d
1 changed files with 9 additions and 3 deletions
  1. 9 3
      fcl/unix/process.inc

+ 9 - 3
fcl/unix/process.inc

@@ -304,9 +304,15 @@ begin
     Try  
       Argv:=MakeCommand(Self);
       Try
-        PName:=ApplicationName;
-        If (PName='') then
-          PName:=CommandLine;
+        If (Argv<>Nil) and (ArgV[0]<>Nil) then
+          PName:=StrPas(Argv[0])
+        else
+          begin  
+          // This should never happen, actually.
+          PName:=ApplicationName;
+          If (PName='') then
+            PName:=CommandLine;
+          end;  
         if (pos('/',PName)<>1) then
           PName:=FileSearch(Pname,fpgetenv('PATH'));
         Pid:=fpfork;