commit 46ebad135d9dc52eb84d6985393298465fa7b3ff from: Omar Polo date: Thu Mar 17 16:38:43 2022 UTC style commit - 60aa1fa0d1bdadc23596e5d614d184525b17935c commit + 46ebad135d9dc52eb84d6985393298465fa7b3ff blob - acd793bdf71f41420eda39d2a713aaca2c159a43 blob + 4aabb46d0d6d31262d423862cce84ad3cf0b11f6 --- lib/patch.c +++ lib/patch.c @@ -305,8 +305,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) { @@ -355,7 +355,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; } @@ -376,14 +376,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; } @@ -413,7 +413,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 - 0f19ba3a58a9ae3c8acd25da10ed6237d9fe334b blob + deb0e8192f09bb269bb784019dc776e0602e2925 --- libexec/got-read-patch/got-read-patch.c +++ libexec/got-read-patch/got-read-patch.c @@ -103,7 +103,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); @@ -118,7 +118,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'; @@ -292,7 +292,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");