mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-09 04:38:45 +02:00
fixed loading xpm files with static const unsigned char
git-svn-id: trunk@8355 -
This commit is contained in:
parent
6f345ed1d4
commit
096aee4574
@ -39,8 +39,9 @@ var
|
|||||||
LastChar: Char;
|
LastChar: Char;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
//DebugLn('TestStreamIsXPM ');
|
||||||
OldPosition:=AStream.Position;
|
OldPosition:=AStream.Position;
|
||||||
// skip comments and search 'static char*'
|
// skip comments and search 'static [const] [unsigned] char*'
|
||||||
Range:=xrCode;
|
Range:=xrCode;
|
||||||
try
|
try
|
||||||
repeat
|
repeat
|
||||||
@ -70,9 +71,22 @@ begin
|
|||||||
'c':
|
'c':
|
||||||
begin
|
begin
|
||||||
if Range<>xrStaticKeyWord then exit;
|
if Range<>xrStaticKeyWord then exit;
|
||||||
// read 'har', the rest of 'char'
|
if (AStream.Read(c,1)<>1) then exit;
|
||||||
if not Check('har') then exit;
|
if (c='o') then begin
|
||||||
Range:=xrCharKeyWord;
|
// read 'nst', the rest of 'const'
|
||||||
|
if not Check('nst') then exit;
|
||||||
|
end else if (c='h') then begin
|
||||||
|
// read 'ar', the rest of 'char'
|
||||||
|
if not Check('ar') then exit;
|
||||||
|
Range:=xrCharKeyWord;
|
||||||
|
end else
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
'u':
|
||||||
|
begin
|
||||||
|
if Range<>xrStaticKeyWord then exit;
|
||||||
|
// read 'nsigned', the rest of 'unsigned'
|
||||||
|
if not Check('nsigned') then exit;
|
||||||
end;
|
end;
|
||||||
'*':
|
'*':
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user