diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-13 16:41:15 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-13 16:41:15 +0200 |
commit | 6373bb7740c6256154f6b1728321fd636e4f5a2a (patch) | |
tree | a1ea6c1e3b0faa7200c88c5db127ea1d5fc13d10 | |
parent | 760d0ebbe5edaedb60b4de64bde2ad098d1f45d9 (diff) | |
download | busybox-w32-6373bb7740c6256154f6b1728321fd636e4f5a2a.tar.gz busybox-w32-6373bb7740c6256154f6b1728321fd636e4f5a2a.tar.bz2 busybox-w32-6373bb7740c6256154f6b1728321fd636e4f5a2a.zip |
patch: move closer to toybox code
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/patch.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/editors/patch.c b/editors/patch.c index b12c662f4..693af5b7d 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -82,6 +82,9 @@ void TOY_llist_free(void *list, void (*freeit)(void *data)) | |||
82 | if (list==pop) break; | 82 | if (list==pop) break; |
83 | } | 83 | } |
84 | } | 84 | } |
85 | //Override bbox's names | ||
86 | #define llist_pop TOY_llist_pop | ||
87 | #define llist_free TOY_llist_free | ||
85 | 88 | ||
86 | // Add an entry to the end off a doubly linked list | 89 | // Add an entry to the end off a doubly linked list |
87 | static | 90 | static |
@@ -292,7 +295,7 @@ static void fail_hunk(void) | |||
292 | // this file and advance to next file. | 295 | // this file and advance to next file. |
293 | 296 | ||
294 | TT.state = 2; | 297 | TT.state = 2; |
295 | TOY_llist_free(TT.current_hunk, do_line); | 298 | llist_free(TT.current_hunk, do_line); |
296 | TT.current_hunk = NULL; | 299 | TT.current_hunk = NULL; |
297 | delete_tempfile(TT.filein, TT.fileout, &TT.tempname); | 300 | delete_tempfile(TT.filein, TT.fileout, &TT.tempname); |
298 | TT.state = 0; | 301 | TT.state = 0; |
@@ -378,7 +381,7 @@ static int apply_one_hunk(void) | |||
378 | fdprintf(2, "NOT: %s\n", plist->data); | 381 | fdprintf(2, "NOT: %s\n", plist->data); |
379 | 382 | ||
380 | TT.state = 3; | 383 | TT.state = 3; |
381 | check = TOY_llist_pop(&buf); | 384 | check = llist_pop(&buf); |
382 | check->prev->next = buf; | 385 | check->prev->next = buf; |
383 | buf->prev = check->prev; | 386 | buf->prev = check->prev; |
384 | do_line(check); | 387 | do_line(check); |
@@ -405,13 +408,13 @@ static int apply_one_hunk(void) | |||
405 | out: | 408 | out: |
406 | // We have a match. Emit changed data. | 409 | // We have a match. Emit changed data. |
407 | TT.state = "-+"[reverse]; | 410 | TT.state = "-+"[reverse]; |
408 | TOY_llist_free(TT.current_hunk, do_line); | 411 | llist_free(TT.current_hunk, do_line); |
409 | TT.current_hunk = NULL; | 412 | TT.current_hunk = NULL; |
410 | TT.state = 1; | 413 | TT.state = 1; |
411 | done: | 414 | done: |
412 | if (buf) { | 415 | if (buf) { |
413 | buf->prev->next = NULL; | 416 | buf->prev->next = NULL; |
414 | TOY_llist_free(buf, do_line); | 417 | llist_free(buf, do_line); |
415 | } | 418 | } |
416 | 419 | ||
417 | return TT.state; | 420 | return TT.state; |