Add a fcn wl_delete to free the wordlist, but not its wl_word contents.

This commit is contained in:
Holger Vogt
2024-05-14 16:30:49 +02:00
parent 97d9f38421
commit fc7ba6ee8f
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -39,6 +39,18 @@ wl_free(wordlist *wl)
}
}
/* Free the storage used by the word list only,
but not the wl->wl_word. */
void
wl_delete(wordlist* wl)
{
while (wl) {
wordlist* next = wl->wl_next;
tfree(wl);
wl = next;
}
}
/* Copy a wordlist and the words. */
wordlist *