mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:29:32 +02:00
* Patch from Werner Pamler to fix getval
git-svn-id: trunk@43141 -
This commit is contained in:
parent
7ff2603c22
commit
0ccb7d951f
@ -119,11 +119,13 @@ begin
|
||||
inc(S); // skip space
|
||||
P:= S;
|
||||
|
||||
// Skip
|
||||
// Skip tag name
|
||||
while not (P^ in ['=', ' ', '>', #0]) do
|
||||
inc(P);
|
||||
|
||||
if (P^ = '=') then inc(P);
|
||||
// Skip spaces and '='
|
||||
while (P^ in ['=', ' ']) do
|
||||
inc(P);
|
||||
|
||||
while not (P^ in [' ','>',#0]) do
|
||||
begin
|
||||
@ -161,12 +163,15 @@ var
|
||||
S: Pchar;
|
||||
C: Char;
|
||||
begin
|
||||
Result := '';
|
||||
|
||||
P:= Pchar(namevalpair);
|
||||
S:= StrPos(P, '=');
|
||||
|
||||
if S <> nil then
|
||||
begin
|
||||
inc(S); // skip equal
|
||||
while S^ = ' ' do inc(S); // skip any spaces after =
|
||||
P:= S; // set P to a character after =
|
||||
|
||||
if (P^ in ['"','''']) then
|
||||
@ -181,9 +186,7 @@ begin
|
||||
inc(P);
|
||||
|
||||
if (P <> S) then { Thanks to Dave Keighan (keighand@yahoo.com) }
|
||||
Result:= CopyBuffer(S, P - S)
|
||||
else
|
||||
Result:= '';
|
||||
Result:= CopyBuffer(S, P - S);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user