* fix for SIGSEGV in Exec without command line parameters revealed in discussion for #26160

git-svn-id: trunk@27804 -
This commit is contained in:
Tomas Hajny 2014-05-18 20:37:40 +00:00
parent bb0a670e9e
commit cedf009d3c
3 changed files with 6 additions and 8 deletions

View File

@ -436,8 +436,7 @@ begin
seg_move (get_ds, PtrInt (ExecBufPtr), DosMemSelector, TB, Pred (Current_Dos_Buffer_Pos));
{ allocate FCB see dosexec code }
arg_ofs:=1;
while (c[arg_ofs] in [' ',#9]) and
(arg_ofs<length(c)) do
while (arg_ofs<length(c)) and (c[arg_ofs] in [' ',#9]) do
inc(arg_ofs);
dosregs.ax:=$2901;
dosregs.ds:=(la_c+arg_ofs) shr 4;

View File

@ -237,8 +237,7 @@ begin
GetShortName(p);
{ allocate FCB see dosexec code }
arg_ofs:=1;
while (c[arg_ofs] in [' ',#9]) and
(arg_ofs<length(c)) do
while (arg_ofs<length(c)) and (c[arg_ofs] in [' ',#9]) do
inc(arg_ofs);
dosregs.ax:=$2901;
dosregs.ds:=Seg(c[arg_ofs]);

View File

@ -228,7 +228,7 @@ begin
la_e:=la_e+16;
{ allocate FCB see dosexec code }
arg_ofs:=1;
while (c[arg_ofs] in [' ',#9]) do
while (arg_ofs < Length (C)) and (c[arg_ofs] in [' ',#9]) do
inc(arg_ofs);
dosregs.ax:=$2901;
dosregs.ds:=(la_c+arg_ofs) shr 4;
@ -239,12 +239,12 @@ begin
{ allocate second FCB see dosexec code }
repeat
inc(arg_ofs);
until (c[arg_ofs] in [' ',#9,#13]);
if c[arg_ofs]<>#13 then
until (Arg_Ofs >= Length (C)) or (c[arg_ofs] in [' ',#9,#13]);
if (c[arg_ofs]<>#13) and (Arg_Ofs < Length (C)) then
begin
repeat
inc(arg_ofs);
until not (c[arg_ofs] in [' ',#9]);
until (Arg_Ofs > Length (C)) or not (c[arg_ofs] in [' ',#9]);
end;
dosregs.ax:=$2901;
dosregs.ds:=(la_c+arg_ofs) shr 4;