瀏覽代碼

+ Fix for command-line property

michael 21 年之前
父節點
當前提交
973bf7028d
共有 1 個文件被更改,包括 9 次插入3 次删除
  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;