commit - 60aa1fa0d1bdadc23596e5d614d184525b17935c
commit + 46ebad135d9dc52eb84d6985393298465fa7b3ff
blob - acd793bdf71f41420eda39d2a713aaca2c159a43
blob + 4aabb46d0d6d31262d423862cce84ad3cf0b11f6
--- lib/patch.c
+++ lib/patch.c
}
(*lineno)++;
- if ((mode == ' ' && !strcmp(h->lines[0]+1, line)) ||
- (mode == '-' && !strcmp(h->lines[0]+1, line)) ||
+ if ((mode == ' ' && !strcmp(h->lines[0] + 1, line)) ||
+ (mode == '-' && !strcmp(h->lines[0] + 1, line)) ||
(mode == '+' && *lineno == h->old_from)) {
match = ftello(orig);
if (match == -1) {
GOT_ERR_HUNK_FAILED);
goto done;
}
- if (strcmp(h->lines[i]+1, line)) {
+ if (strcmp(h->lines[i] + 1, line)) {
err = got_error(GOT_ERR_HUNK_FAILED);
goto done;
}
for (i = 0; i < h->len; ++i) {
switch (*h->lines[i]) {
case ' ':
- if (fprintf(tmp, "%s", h->lines[i]+1) < 0)
+ if (fprintf(tmp, "%s", h->lines[i] + 1) < 0)
return got_error_from_errno("fprintf");
/* fallthrough */
case '-':
(*lineno)++;
break;
case '+':
- if (fprintf(tmp, "%s", h->lines[i]+1) < 0)
+ if (fprintf(tmp, "%s", h->lines[i] + 1) < 0)
return got_error_from_errno("fprintf");
break;
}
if (nop)
return NULL;
for (i = 0; i < h->len; ++i) {
- if (fprintf(tmp, "%s", h->lines[i]+1) < 0)
+ if (fprintf(tmp, "%s", h->lines[i] + 1) < 0)
return got_error_from_errno("fprintf");
}
return err;
blob - 0f19ba3a58a9ae3c8acd25da10ed6237d9fe334b
blob + deb0e8192f09bb269bb784019dc776e0602e2925
--- libexec/got-read-patch/got-read-patch.c
+++ libexec/got-read-patch/got-read-patch.c
at++;
/* files can be created or removed by diffing against /dev/null */
- if (!strncmp(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL)-1))
+ if (!strncmp(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL) - 1))
return NULL;
t = strdup(at);
++t) {
if (t[0] == '/' && t[1] != '/' && t[1] != '\0')
if (--l >= 0)
- *name = t+1;
+ *name = t + 1;
}
*t = '\0';
}
if (imsg_compose(&ibuf, GOT_IMSG_PATCH_LINE, 0, 0, -1,
- line, strlen(line)+1) == -1)
+ line, strlen(line) + 1) == -1)
err = got_error_from_errno(
"imsg_compose GOT_IMSG_PATCH_LINE");