aboutsummaryrefslogtreecommitdiff
path: root/toys/patch.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-07-15 17:22:04 -0500
committerRob Landley <rob@landley.net>2012-07-15 17:22:04 -0500
commit9e2b6db36ab6486172fccd0e1786532826d58c53 (patch)
tree8027567bf76e073ad13594d634e0268de6f83e05 /toys/patch.c
parent2037b8396427ab82edd1912357e9177a2800b01a (diff)
downloadtoybox-9e2b6db36ab6486172fccd0e1786532826d58c53.tar.gz
Genericize llist code a bit: rename llist_free() to llist_traverse(), and no longer accept NULL as a synonym for free.
Diffstat (limited to 'toys/patch.c')
-rw-r--r--toys/patch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toys/patch.c b/toys/patch.c
index 95702ae6..647bb18f 100644
--- a/toys/patch.c
+++ b/toys/patch.c
@@ -108,7 +108,7 @@ static void fail_hunk(void)
// this file and advance to next file.
TT.state = 2;
- llist_free(TT.current_hunk, do_line);
+ llist_traverse(TT.current_hunk, do_line);
TT.current_hunk = NULL;
delete_tempfile(TT.filein, TT.fileout, &TT.tempname);
TT.state = 0;
@@ -221,13 +221,13 @@ static int apply_one_hunk(void)
out:
// We have a match. Emit changed data.
TT.state = "-+"[reverse];
- llist_free(TT.current_hunk, do_line);
+ llist_traverse(TT.current_hunk, do_line);
TT.current_hunk = NULL;
TT.state = 1;
done:
if (buf) {
buf->prev->next = NULL;
- llist_free(buf, do_line);
+ llist_traverse(buf, do_line);
}
return TT.state;