summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko2016-11-28 01:22:57 +0100
committerDenys Vlasenko2016-11-28 01:22:57 +0100
commit1d3a04a3a4be8682d4317251fc14e81ad655d58a (patch)
tree2ee72930778afa3a223327fec714c81d936f82dc /editors
parent038a977d47c99c3e59d7a2393799b2afa838604c (diff)
downloadbusybox-1d3a04a3a4be8682d4317251fc14e81ad655d58a.zip
busybox-1d3a04a3a4be8682d4317251fc14e81ad655d58a.tar.gz
Code style fixes, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/patch.c11
-rw-r--r--editors/patch_toybox.c7
-rw-r--r--editors/sed.c5
3 files changed, 13 insertions, 10 deletions
diff --git a/editors/patch.c b/editors/patch.c
index ea1fc09..731a8c5 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -247,7 +247,7 @@ static int apply_one_hunk(void)
// Figure out which line of hunk to compare with next. (Skip lines
// of the hunk we'd be adding.)
while (plist && *plist->data == "+-"[reverse]) {
- if (data && !strcmp(data, plist->data+1)) {
+ if (data && strcmp(data, plist->data+1) == 0) {
if (!backwarn) {
backwarn = TT.linenum;
if (option_mask32 & FLAG_IGNORE) {
@@ -291,8 +291,9 @@ static int apply_one_hunk(void)
for (;;) {
while (plist && *plist->data == "+-"[reverse]) {
- if (!strcmp(check->data, plist->data+1) &&
- !backwarn) {
+ if (strcmp(check->data, plist->data+1) == 0
+ && !backwarn
+ ) {
backwarn = TT.linenum;
if (option_mask32 & FLAG_IGNORE) {
dummy_revert = 1;
@@ -491,7 +492,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// We're deleting oldname if new file is /dev/null (before -p)
// or if new hunk is empty (zero context) after patching
- if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) {
+ if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) {
name = reverse ? newname : oldname;
empty = 1;
}
@@ -527,7 +528,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
struct stat statbuf;
// If the old file was null, we're creating a new one.
- if (!strcmp(oldname, "/dev/null") || !oldsum) {
+ if (strcmp(oldname, "/dev/null") == 0 || !oldsum) {
printf("creating %s\n", name);
s = strrchr(name, '/');
if (s) {
diff --git a/editors/patch_toybox.c b/editors/patch_toybox.c
index a60bf07..5174acd 100644
--- a/editors/patch_toybox.c
+++ b/editors/patch_toybox.c
@@ -335,7 +335,7 @@ static int apply_one_hunk(void)
// Figure out which line of hunk to compare with next. (Skip lines
// of the hunk we'd be adding.)
while (plist && *plist->data == "+-"[reverse]) {
- if (data && !strcmp(data, plist->data+1)) {
+ if (data && strcmp(data, plist->data+1) == 0) {
if (!backwarn) {
fdprintf(2,"Possibly reversed hunk %d at %ld\n",
TT.hunknum, TT.linenum);
@@ -529,8 +529,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// We're deleting oldname if new file is /dev/null (before -p)
// or if new hunk is empty (zero context) after patching
- if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum))
- {
+ if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) {
name = reverse ? newname : oldname;
del++;
}
@@ -551,7 +550,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// If we've got a file to open, do so.
} else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) {
// If the old file was null, we're creating a new one.
- if (!strcmp(oldname, "/dev/null") || !oldsum) {
+ if (strcmp(oldname, "/dev/null") == 0 || !oldsum) {
printf("creating %s\n", name);
s = strrchr(name, '/');
if (s) {
diff --git a/editors/sed.c b/editors/sed.c
index b7add1f..637a685 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -892,7 +892,10 @@ static sed_cmd_t *branch_to(char *label)
sed_cmd_t *sed_cmd;
for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
- if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) {
+ if (sed_cmd->cmd == ':'
+ && sed_cmd->string
+ && strcmp(sed_cmd->string, label) == 0
+ ) {
return sed_cmd;
}
}