mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 21:28:03 +02:00
* fix a bug in Exec if calling a program without arguments
git-svn-id: trunk@29526 -
This commit is contained in:
parent
f263da87a2
commit
dcffcd22e7
@ -213,6 +213,7 @@ var
|
||||
SR: SearchRec;
|
||||
MaxArgsSize: PtrUInt; (* Amount of memory reserved for arguments in bytes. *)
|
||||
MaxArgsSizeInc: word;
|
||||
PathZ: array [0..255] of char;
|
||||
|
||||
begin
|
||||
{ LastDosExitCode := Exec (Path, ExecRunFlags (ExecFlags), efDefault, ComLine);}
|
||||
@ -235,6 +236,8 @@ begin
|
||||
begin
|
||||
Args0 := nil;
|
||||
Args := nil;
|
||||
StrPCopy (PathZ, Path);
|
||||
RC := DosQueryAppType (@PathZ [0], ExecAppType);
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -266,9 +269,9 @@ begin
|
||||
Args^ [ArgSize] := 0;
|
||||
Inc (ArgSize);
|
||||
Args^ [ArgSize] := 0;
|
||||
RC := DosQueryAppType (PChar (Args), ExecAppType);
|
||||
end;
|
||||
|
||||
RC := DosQueryAppType (PChar (Args), ExecAppType);
|
||||
if RC <> 0 then
|
||||
OSErrorWatch (RC)
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user