mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 11:30:35 +02:00
* patch by Bart B: Fix for TryStrToConvUnit in ConvUtils unit, resolves #39797
This commit is contained in:
parent
b2a5334a75
commit
160c5a3d39
@ -397,8 +397,13 @@ begin
|
||||
ValueStr:=Copy(AText,1,P);
|
||||
if not TryStrToFloat(ValueStr, AValue) then
|
||||
Exit;
|
||||
while AText[P]=#32 do Inc(P);
|
||||
TypeStr:=Copy(AText,P,MaxInt);
|
||||
//since there is no restriction on the description of a TConvType
|
||||
//(it can be empty or have leading or trailing spaces)
|
||||
//everything after the space at position P _must_ be the description
|
||||
if P=Length(AText) then
|
||||
TypeStr:=''
|
||||
else
|
||||
TypeStr:=Copy(AText,P+1,MaxInt);
|
||||
Result:=DescriptionToConvType(TypeStr, AType);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user