summaryrefslogtreecommitdiff
path: root/editors/patch.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-08-30 16:41:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2022-08-30 16:41:17 +0200
commitfe73c8d55795a8fe7e95fc2c00af6899817b96b8 (patch)
tree1b772243f00c63d16ee4cf8bf6f80a6c7a53ee91 /editors/patch.c
parent58598eb7093561d914a6254697e137b815f1fdfc (diff)
downloadbusybox-fe73c8d55795a8fe7e95fc2c00af6899817b96b8.tar.gz
*: style fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/patch.c')
-rw-r--r--editors/patch.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/patch.c b/editors/patch.c
index aebb5073e..f90d6854d 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -138,9 +138,9 @@ static void do_line(void *data)
{
struct double_list *dlist = data;
- if (TT.state>1 && *dlist->data != TT.state)
+ if (TT.state > 1 && *dlist->data != TT.state)
fdprintf(TT.state == 2 ? 2 : TT.fileout,
- "%s\n", dlist->data+(TT.state>3 ? 1 : 0));
+ "%s\n", dlist->data + (TT.state > 3 ? 1 : 0));
if (PATCH_DEBUG) fdprintf(2, "DO %d: %s\n", TT.state, dlist->data);
@@ -221,7 +221,7 @@ static int apply_one_hunk(void)
// Match EOF if there aren't as many ending context lines as beginning
for (plist = TT.current_hunk; plist; plist = plist->next) {
- if (plist->data[0]==' ') matcheof++;
+ if (plist->data[0] == ' ') matcheof++;
else matcheof = 0;
if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data);
}
@@ -433,15 +433,15 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// Are we assembling a hunk?
if (state >= 2) {
- if (*patchline==' ' || *patchline=='+' || *patchline=='-') {
+ if (*patchline == ' ' || *patchline == '+' || *patchline == '-') {
dlist_add(&TT.current_hunk, patchline);
if (*patchline != '+') oldlen--;
if (*patchline != '-') newlen--;
// Context line?
- if (*patchline==' ' && state==2) TT.context++;
- else state=3;
+ if (*patchline == ' ' && state == 2) TT.context++;
+ else state = 3;
// If we've consumed all expected hunk lines, apply the hunk.
@@ -469,9 +469,9 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
free(*name);
// Trim date from end of filename (if any). We don't care.
for (s = patchline+4; *s && *s!='\t'; s++)
- if (*s=='\\' && s[1]) s++;
+ if (*s == '\\' && s[1]) s++;
i = atoi(s);
- if (i>1900 && i<=1970)
+ if (i > 1900 && i <= 1970)
*name = xstrdup("/dev/null");
else {
*s = 0;