diff options
author | Rob Landley <rob@landley.net> | 2013-09-09 05:26:52 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-09-09 05:26:52 -0500 |
commit | bb215e4a1fece603cdede556c1107135b31312a0 (patch) | |
tree | 61c4e038856cd84a3693df6a56a529202ec3f1f0 /toys/posix | |
parent | 5f57bccc41c8893914121b00e16a96dd16282486 (diff) | |
download | toybox-bb215e4a1fece603cdede556c1107135b31312a0.tar.gz |
Adjust patch to use dlist_pop()
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/patch.c | 10 |
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); |