mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 03:48:07 +02:00
* fix for SIGSEGV in Exec without command line parameters revealed in discussion for #26160
git-svn-id: trunk@27804 -
This commit is contained in:
parent
bb0a670e9e
commit
cedf009d3c
@ -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;
|
||||
|
@ -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]);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user