word->type = GRUB2_WORD_TEXT;
word->text = talloc_strdup(word, text);
word->next = NULL;
+ word->last = word;
return word;
}
word->var.name = talloc_strdup(word, name);
word->var.split = split;
word->next = NULL;
+ word->last = word;
return word;
}
void word_append(struct grub2_word *w1, struct grub2_word *w2)
{
- w1->next = w2;
+ w1->last->next = w2;
+ w1->last = w2;
}