diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-28 01:22:57 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-28 01:22:57 +0100 |
commit | 1d3a04a3a4be8682d4317251fc14e81ad655d58a (patch) | |
tree | 2ee72930778afa3a223327fec714c81d936f82dc /editors/patch.c | |
parent | 038a977d47c99c3e59d7a2393799b2afa838604c (diff) | |
download | busybox-w32-1d3a04a3a4be8682d4317251fc14e81ad655d58a.tar.gz busybox-w32-1d3a04a3a4be8682d4317251fc14e81ad655d58a.tar.bz2 busybox-w32-1d3a04a3a4be8682d4317251fc14e81ad655d58a.zip |
Code style fixes, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/patch.c')
-rw-r--r-- | editors/patch.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/editors/patch.c b/editors/patch.c index ea1fc0974..731a8c58a 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -247,7 +247,7 @@ static int apply_one_hunk(void) | |||
247 | // Figure out which line of hunk to compare with next. (Skip lines | 247 | // Figure out which line of hunk to compare with next. (Skip lines |
248 | // of the hunk we'd be adding.) | 248 | // of the hunk we'd be adding.) |
249 | while (plist && *plist->data == "+-"[reverse]) { | 249 | while (plist && *plist->data == "+-"[reverse]) { |
250 | if (data && !strcmp(data, plist->data+1)) { | 250 | if (data && strcmp(data, plist->data+1) == 0) { |
251 | if (!backwarn) { | 251 | if (!backwarn) { |
252 | backwarn = TT.linenum; | 252 | backwarn = TT.linenum; |
253 | if (option_mask32 & FLAG_IGNORE) { | 253 | if (option_mask32 & FLAG_IGNORE) { |
@@ -291,8 +291,9 @@ static int apply_one_hunk(void) | |||
291 | 291 | ||
292 | for (;;) { | 292 | for (;;) { |
293 | while (plist && *plist->data == "+-"[reverse]) { | 293 | while (plist && *plist->data == "+-"[reverse]) { |
294 | if (!strcmp(check->data, plist->data+1) && | 294 | if (strcmp(check->data, plist->data+1) == 0 |
295 | !backwarn) { | 295 | && !backwarn |
296 | ) { | ||
296 | backwarn = TT.linenum; | 297 | backwarn = TT.linenum; |
297 | if (option_mask32 & FLAG_IGNORE) { | 298 | if (option_mask32 & FLAG_IGNORE) { |
298 | dummy_revert = 1; | 299 | dummy_revert = 1; |
@@ -491,7 +492,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
491 | 492 | ||
492 | // We're deleting oldname if new file is /dev/null (before -p) | 493 | // We're deleting oldname if new file is /dev/null (before -p) |
493 | // or if new hunk is empty (zero context) after patching | 494 | // or if new hunk is empty (zero context) after patching |
494 | if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) { | 495 | if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) { |
495 | name = reverse ? newname : oldname; | 496 | name = reverse ? newname : oldname; |
496 | empty = 1; | 497 | empty = 1; |
497 | } | 498 | } |
@@ -527,7 +528,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
527 | struct stat statbuf; | 528 | struct stat statbuf; |
528 | 529 | ||
529 | // If the old file was null, we're creating a new one. | 530 | // If the old file was null, we're creating a new one. |
530 | if (!strcmp(oldname, "/dev/null") || !oldsum) { | 531 | if (strcmp(oldname, "/dev/null") == 0 || !oldsum) { |
531 | printf("creating %s\n", name); | 532 | printf("creating %s\n", name); |
532 | s = strrchr(name, '/'); | 533 | s = strrchr(name, '/'); |
533 | if (s) { | 534 | if (s) { |