mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:05:57 +02:00
* explicit check for Nil in AnsiExtractQuotedString (bug 31212)
git-svn-id: trunk@35598 -
This commit is contained in:
parent
0ad519aac5
commit
0ee31963ed
@ -678,13 +678,15 @@ function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;
|
|||||||
var
|
var
|
||||||
P,Q,R: PChar;
|
P,Q,R: PChar;
|
||||||
begin
|
begin
|
||||||
|
result:='';
|
||||||
|
if P=Nil then exit;
|
||||||
P := Src;
|
P := Src;
|
||||||
Q := StrEnd(P);
|
Q := StrEnd(P);
|
||||||
result:='';
|
if P=Q then
|
||||||
if P=Q then exit;
|
exit;
|
||||||
if P^<>quote then exit(strpas(P));
|
if P^<>quote then
|
||||||
|
exit(strpas(P));
|
||||||
inc(p);
|
inc(p);
|
||||||
|
|
||||||
setlength(result,(Q-P)+1);
|
setlength(result,(Q-P)+1);
|
||||||
R:=@Result[1];
|
R:=@Result[1];
|
||||||
while P <> Q do
|
while P <> Q do
|
||||||
@ -1904,7 +1906,6 @@ var p : pchar;
|
|||||||
begin
|
begin
|
||||||
p:=pchar(pointer(s)); // work around CONST. Ansiextract is safe for nil
|
p:=pchar(pointer(s)); // work around CONST. Ansiextract is safe for nil
|
||||||
result:=AnsiExtractquotedStr(p,AQuote);
|
result:=AnsiExtractquotedStr(p,AQuote);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function StrToBool(const S: string): Boolean;
|
function StrToBool(const S: string): Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user