commit 17d6446ae871d15954803d493cdcc3e9dd968e2c from: Omar Polo via: Thomas Adam date: Tue Mar 22 17:53:47 2022 UTC style commit - 49114f01f4c397e460d9d2d27619e841184b217a commit + 17d6446ae871d15954803d493cdcc3e9dd968e2c blob - 00f3cb4c47a4fdfc0236500f630015dc176b74b8 blob + a4dd3518c6cae60e4d751e39aeb2ad2e706789f0 --- lib/patch.c +++ lib/patch.c @@ -304,8 +304,8 @@ locate_hunk(FILE *orig, struct got_patch_hunk *h, off_ } (*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) { @@ -354,7 +354,7 @@ test_hunk(FILE *orig, struct got_patch_hunk *h) 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; } @@ -375,14 +375,14 @@ apply_hunk(FILE *tmp, struct got_patch_hunk *h, long * 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; } @@ -412,7 +412,7 @@ patch_file(struct got_patch *p, const char *path, FILE 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 - 3f72d2e5886ae7692cb6e58f9b047cd2fe8da0a0 blob + 47f1113850fb0008036c2a317d9d93163797019f --- libexec/got-read-patch/got-read-patch.c +++ libexec/got-read-patch/got-read-patch.c @@ -102,7 +102,7 @@ filename(const char *at, char **name, int strip) 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); @@ -117,7 +117,7 @@ filename(const char *at, char **name, int strip) ++t) { if (t[0] == '/' && t[1] != '/' && t[1] != '\0') if (--l >= 0) - *name = t+1; + *name = t + 1; } *t = '\0'; @@ -291,7 +291,7 @@ send_line(const char *line) } 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");