summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index ac50270..6f12683 100644
--- a/misc.c
+++ b/misc.c
@@ -485,7 +485,7 @@ find_next_token (char **ptr, unsigned int *lengthptr)
with the same contents as the old one. */
struct dep *
-copy_dep_chain (struct dep *d)
+copy_dep_chain (const struct dep *d)
{
register struct dep *c;
struct dep *firstnew = 0;
@@ -508,6 +508,21 @@ copy_dep_chain (struct dep *d)
return firstnew;
}
+
+/* Free a chain of 'struct dep'. */
+
+void
+free_dep_chain (struct dep *d)
+{
+ while (d != 0)
+ {
+ struct dep *df = d;
+ d = d->next;
+
+ free (df->name);
+ free ((char *)df);
+ }
+}
/* Free a chain of `struct nameseq'. Each nameseq->name is freed
as well. Can be used on `struct dep' chains.*/