mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 23:39:39 +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
|
inc(S); // skip space
|
||||||
P:= S;
|
P:= S;
|
||||||
|
|
||||||
// Skip
|
// Skip tag name
|
||||||
while not (P^ in ['=', ' ', '>', #0]) do
|
while not (P^ in ['=', ' ', '>', #0]) do
|
||||||
inc(P);
|
inc(P);
|
||||||
|
|
||||||
if (P^ = '=') then inc(P);
|
// Skip spaces and '='
|
||||||
|
while (P^ in ['=', ' ']) do
|
||||||
|
inc(P);
|
||||||
|
|
||||||
while not (P^ in [' ','>',#0]) do
|
while not (P^ in [' ','>',#0]) do
|
||||||
begin
|
begin
|
||||||
@ -161,12 +163,15 @@ var
|
|||||||
S: Pchar;
|
S: Pchar;
|
||||||
C: Char;
|
C: Char;
|
||||||
begin
|
begin
|
||||||
|
Result := '';
|
||||||
|
|
||||||
P:= Pchar(namevalpair);
|
P:= Pchar(namevalpair);
|
||||||
S:= StrPos(P, '=');
|
S:= StrPos(P, '=');
|
||||||
|
|
||||||
if S <> nil then
|
if S <> nil then
|
||||||
begin
|
begin
|
||||||
inc(S); // skip equal
|
inc(S); // skip equal
|
||||||
|
while S^ = ' ' do inc(S); // skip any spaces after =
|
||||||
P:= S; // set P to a character after =
|
P:= S; // set P to a character after =
|
||||||
|
|
||||||
if (P^ in ['"','''']) then
|
if (P^ in ['"','''']) then
|
||||||
@ -181,9 +186,7 @@ begin
|
|||||||
inc(P);
|
inc(P);
|
||||||
|
|
||||||
if (P <> S) then { Thanks to Dave Keighan (keighand@yahoo.com) }
|
if (P <> S) then { Thanks to Dave Keighan (keighand@yahoo.com) }
|
||||||
Result:= CopyBuffer(S, P - S)
|
Result:= CopyBuffer(S, P - S);
|
||||||
else
|
|
||||||
Result:= '';
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user