diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-25T23·06+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-25T23·06+0100 |
commit | 93ba78d6f4632ef1c5228965e3edc8c0faf88c1e (patch) | |
tree | 85730c182a9f5f492ade8e8ccdb1c2356f9900bd /third_party/git/xdiff-interface.c | |
parent | 6f8fbf4aa4b1654ab27d4829e114538761817de0 (diff) |
revert(3p/git): Revert merge of git upstream at v2.26.2 r/852
This causes cgit to serve error pages, which is undesirable. This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing changes made to f2b211131f2347342dde63975b09cf603149f1a3.
Diffstat (limited to 'third_party/git/xdiff-interface.c')
-rw-r--r-- | third_party/git/xdiff-interface.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/third_party/git/xdiff-interface.c b/third_party/git/xdiff-interface.c index 4d20069302b2..8509f9ea223a 100644 --- a/third_party/git/xdiff-interface.c +++ b/third_party/git/xdiff-interface.c @@ -84,8 +84,8 @@ static void trim_common_tail(mmfile_t *a, mmfile_t *b) { const int blk = 1024; long trimmed = 0, recovered = 0; - char *ap = a->size ? a->ptr + a->size : a->ptr; - char *bp = b->size ? b->ptr + b->size : b->ptr; + char *ap = a->ptr + a->size; + char *bp = b->ptr + b->size; long smaller = (a->size < b->size) ? a->size : b->size; while (blk + trimmed <= smaller && !memcmp(ap - blk, bp - blk, blk)) { @@ -250,13 +250,9 @@ void xdiff_set_find_func(xdemitconf_t *xecfg, const char *value, int cflags) ALLOC_ARRAY(regs->array, regs->nr); for (i = 0; i < regs->nr; i++) { struct ff_reg *reg = regs->array + i; - const char *ep, *expression; + const char *ep = strchr(value, '\n'), *expression; char *buffer = NULL; - if (!value) - BUG("mismatch between line count and parsing"); - ep = strchr(value, '\n'); - reg->negate = (*value == '!'); if (reg->negate && i == regs->nr - 1) die("Last expression must not be negated: %s", value); @@ -269,7 +265,7 @@ void xdiff_set_find_func(xdemitconf_t *xecfg, const char *value, int cflags) if (regcomp(®->re, expression, cflags)) die("Invalid regexp to look for hunk header: %s", expression); free(buffer); - value = ep ? ep + 1 : NULL; + value = ep + 1; } } |