aboutsummaryrefslogtreecommitdiff
path: root/editors/patch_toybox.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-28 01:22:57 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-11-28 01:22:57 +0100
commit1d3a04a3a4be8682d4317251fc14e81ad655d58a (patch)
tree2ee72930778afa3a223327fec714c81d936f82dc /editors/patch_toybox.c
parent038a977d47c99c3e59d7a2393799b2afa838604c (diff)
downloadbusybox-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_toybox.c')
-rw-r--r--editors/patch_toybox.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/editors/patch_toybox.c b/editors/patch_toybox.c
index a60bf070f..5174acd6a 100644
--- a/editors/patch_toybox.c
+++ b/editors/patch_toybox.c
@@ -335,7 +335,7 @@ static int apply_one_hunk(void)
335 // Figure out which line of hunk to compare with next. (Skip lines 335 // Figure out which line of hunk to compare with next. (Skip lines
336 // of the hunk we'd be adding.) 336 // of the hunk we'd be adding.)
337 while (plist && *plist->data == "+-"[reverse]) { 337 while (plist && *plist->data == "+-"[reverse]) {
338 if (data && !strcmp(data, plist->data+1)) { 338 if (data && strcmp(data, plist->data+1) == 0) {
339 if (!backwarn) { 339 if (!backwarn) {
340 fdprintf(2,"Possibly reversed hunk %d at %ld\n", 340 fdprintf(2,"Possibly reversed hunk %d at %ld\n",
341 TT.hunknum, TT.linenum); 341 TT.hunknum, TT.linenum);
@@ -529,8 +529,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
529 529
530 // We're deleting oldname if new file is /dev/null (before -p) 530 // We're deleting oldname if new file is /dev/null (before -p)
531 // or if new hunk is empty (zero context) after patching 531 // or if new hunk is empty (zero context) after patching
532 if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) 532 if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) {
533 {
534 name = reverse ? newname : oldname; 533 name = reverse ? newname : oldname;
535 del++; 534 del++;
536 } 535 }
@@ -551,7 +550,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
551 // If we've got a file to open, do so. 550 // If we've got a file to open, do so.
552 } else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) { 551 } else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) {
553 // If the old file was null, we're creating a new one. 552 // If the old file was null, we're creating a new one.
554 if (!strcmp(oldname, "/dev/null") || !oldsum) { 553 if (strcmp(oldname, "/dev/null") == 0 || !oldsum) {
555 printf("creating %s\n", name); 554 printf("creating %s\n", name);
556 s = strrchr(name, '/'); 555 s = strrchr(name, '/');
557 if (s) { 556 if (s) {