mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 19:49:12 +02:00
* skip glibc-specific modifiers while parsing the locale info
(patch by Petr-K, fixes mantis #12148) git-svn-id: trunk@13396 -
This commit is contained in:
parent
4e446c6184
commit
deb052c3f5
@ -104,20 +104,28 @@ procedure GetFormatSettings;
|
|||||||
GetLocaleChar := nl_langinfo(item)^;
|
GetLocaleChar := nl_langinfo(item)^;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure OmitModifiers(const s: string; var i: integer);
|
||||||
|
var
|
||||||
|
l: Integer;
|
||||||
|
begin
|
||||||
|
l := Length(s);
|
||||||
|
//possible flag, with specifier or modifier - glibc exension
|
||||||
|
while (i<=l) and (s[i] in ['0'..'9', '_', '-', '^', '#', 'E', 'O']) do
|
||||||
|
inc(i);
|
||||||
|
end;
|
||||||
|
|
||||||
function FindSeparator(const s: string; Def: char): char;
|
function FindSeparator(const s: string; Def: char): char;
|
||||||
var
|
var
|
||||||
i, l: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
FindSeparator := Def;
|
FindSeparator := Def;
|
||||||
i := Pos('%', s);
|
i := Pos('%', s);
|
||||||
if i=0 then
|
if i=0 then
|
||||||
Exit;
|
Exit;
|
||||||
l := Length(s);
|
|
||||||
inc(i);
|
inc(i);
|
||||||
if (i<=l) and (s[i] in ['E', 'O']) then //possible modifier
|
OmitModifiers(s, i);
|
||||||
inc(i);
|
inc(i);
|
||||||
inc(i);
|
if i<=Length(s) then
|
||||||
if i<=l then
|
|
||||||
FindSeparator := s[i];
|
FindSeparator := s[i];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -133,8 +141,7 @@ procedure GetFormatSettings;
|
|||||||
while i<=l do begin
|
while i<=l do begin
|
||||||
if s[i]='%' then begin
|
if s[i]='%' then begin
|
||||||
inc(i);
|
inc(i);
|
||||||
if (i<=l) and (s[i] in ['E', 'O']) then //ignore modifier
|
OmitModifiers(s, i);
|
||||||
inc(i);
|
|
||||||
if i>l then
|
if i>l then
|
||||||
Exit;
|
Exit;
|
||||||
case s[i] of
|
case s[i] of
|
||||||
|
Loading…
Reference in New Issue
Block a user