Fixed problem with empty macros (#7562)

This commit is contained in:
Dirk Lemstra 2024-08-17 10:12:12 +02:00
parent 25db2e59fb
commit 9fda5f2533
No known key found for this signature in database
GPG key ID: 40B84DE7D6271D30

View file

@ -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;
}
}