mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 20:20:16 +02:00
human68k: one more rework after advices/reports from Pierre Muller, hopefully this fixes all remaning edge cases
This commit is contained in:
parent
5c93f3e271
commit
1e066ba0bd
@ -145,26 +145,24 @@ var
|
|||||||
argsp: pchar;
|
argsp: pchar;
|
||||||
inquotes: boolean;
|
inquotes: boolean;
|
||||||
inarg: boolean;
|
inarg: boolean;
|
||||||
|
i: longint;
|
||||||
begin
|
begin
|
||||||
argc:=0;
|
|
||||||
inquotes:=false;
|
inquotes:=false;
|
||||||
inarg:=false;
|
inarg:=false;
|
||||||
|
|
||||||
p:=@h68k_startup.comm^.buffer;
|
if not assigned(h68k_startup.comm) then
|
||||||
if not assigned(p) then
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
p:=@h68k_startup.comm^.buffer;
|
||||||
argl:=h68k_startup.comm^.len;
|
argl:=h68k_startup.comm^.len;
|
||||||
if argl < 1 then
|
|
||||||
argl:=1;
|
|
||||||
|
|
||||||
args:=getmem(argl+1);
|
args:=getmem(argl+1);
|
||||||
fillchar(args^,argl+1,#0);
|
fillchar(args^,argl+1,#0);
|
||||||
argsp:=args;
|
argsp:=args;
|
||||||
|
|
||||||
while p^ <> #0 do
|
for i:=0 to argl-1 do
|
||||||
begin
|
begin
|
||||||
case p^ of
|
case p[i] of
|
||||||
' ':
|
' ':
|
||||||
begin
|
begin
|
||||||
if not inquotes then
|
if not inquotes then
|
||||||
@ -177,7 +175,7 @@ begin
|
|||||||
argsp^:=#0;
|
argsp^:=#0;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
argsp^:=p^;
|
argsp^:=p[i];
|
||||||
inc(argsp);
|
inc(argsp);
|
||||||
end;
|
end;
|
||||||
'"':
|
'"':
|
||||||
@ -187,11 +185,10 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
inarg:=true;
|
inarg:=true;
|
||||||
argsp^:=p^;
|
argsp^:=p[i];
|
||||||
inc(argsp);
|
inc(argsp);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
inc(p);
|
|
||||||
end;
|
end;
|
||||||
if inarg then
|
if inarg then
|
||||||
inc(argc);
|
inc(argc);
|
||||||
|
Loading…
Reference in New Issue
Block a user