mirror of
https://github.com/imagemagick/imagemagick
synced 2024-10-18 08:52:53 +00:00
Fixed problem with empty macros (#7562)
This commit is contained in:
parent
25db2e59fb
commit
9fda5f2533
|
@ -2439,15 +2439,21 @@ static SplayTreeInfo *GetMVGMacros(const char *primitive)
|
|||
}
|
||||
if (LocaleCompare(token,"push") == 0)
|
||||
n++;
|
||||
if ((n == 0) && (end > start))
|
||||
if ((n == 0) && (end >= start))
|
||||
{
|
||||
size_t
|
||||
length=(size_t) (end-start);
|
||||
|
||||
/*
|
||||
Extract macro.
|
||||
*/
|
||||
(void) GetNextToken(p,&p,extent,token);
|
||||
(void) CopyMagickString(macro,start,(size_t) (end-start));
|
||||
(void) AddValueToSplayTree(macros,ConstantString(name),
|
||||
ConstantString(macro));
|
||||
if (length > 0)
|
||||
{
|
||||
(void) CopyMagickString(macro,start,length);
|
||||
(void) AddValueToSplayTree(macros,ConstantString(name),
|
||||
ConstantString(macro));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue