Do not expand empty strings

Fixes #813
This commit is contained in:
Rangi
2021-03-31 10:21:04 -04:00
parent 49aac2961d
commit c7ed9a275e
5 changed files with 16 additions and 0 deletions

View File

@@ -751,6 +751,10 @@ static void beginExpansion(size_t distance, uint8_t skip,
char const *str, size_t size, bool owned,
char const *name)
{
/* Do not expand empty strings */
if (!size)
return;
distance += lexerState->expansionOfs; /* Distance argument is relative to read offset! */
/* Increase the total length of all parents, and return the topmost one */
struct Expansion *parent = NULL;