From bb215e4a1fece603cdede556c1107135b31312a0 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 9 Sep 2013 05:26:52 -0500 Subject: Adjust patch to use dlist_pop() --- toys/posix/patch.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'toys/posix/patch.c') 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); -- cgit v1.2.3