aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/patch.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-09-09 05:26:52 -0500
committerRob Landley <rob@landley.net>2013-09-09 05:26:52 -0500
commitbb215e4a1fece603cdede556c1107135b31312a0 (patch)
tree61c4e038856cd84a3693df6a56a529202ec3f1f0 /toys/posix/patch.c
parent5f57bccc41c8893914121b00e16a96dd16282486 (diff)
downloadtoybox-bb215e4a1fece603cdede556c1107135b31312a0.tar.gz
Adjust patch to use dlist_pop()
Diffstat (limited to 'toys/posix/patch.c')
-rw-r--r--toys/posix/patch.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/toys/posix/patch.c b/toys/posix/patch.c
index bb443484..7fb6add3 100644
--- a/toys/posix/patch.c
+++ b/toys/posix/patch.c
@@ -204,18 +204,12 @@ static int apply_one_hunk(void)
if (PATCH_DEBUG) fprintf(stderr, "NOT: %s\n", plist->data);
TT.state = 3;
- check = llist_pop(&buf);
- check->prev->next = buf;
- buf->prev = check->prev;
- do_line(check);
+ do_line(check = dlist_pop(&buf));
plist = TT.current_hunk;
// If we've reached the end of the buffer without confirming a
// match, read more lines.
- if (check==buf) {
- buf = 0;
- break;
- }
+ if (!buf) break;
check = buf;
} else {
if (PATCH_DEBUG) fprintf(stderr, "MAYBE: %s\n", plist->data);