* fix a bug in Exec if calling a program without arguments

git-svn-id: trunk@29526 -
This commit is contained in:
Tomas Hajny 2015-01-22 23:11:42 +00:00
parent f263da87a2
commit dcffcd22e7

View File

@ -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