From 63078457a6906ca3e5c34d2f32d528f759d70e66 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 3 Aug 2019 11:47:43 +1000 Subject: [PATCH] Avoid use of "?:" Some compilers (gcc with -pedantic) don't like the ?: construct. So give an explicit middle term. Reported-by: Jari Aalto --- parse.c | 4 ++-- vpatch.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parse.c b/parse.c index 897d0f0..3ef8649 100644 --- a/parse.c +++ b/parse.c @@ -296,7 +296,7 @@ struct plist *parse_patch(FILE *f, FILE *of, int *np) if (of) fputc(c, of); - start = ftell(of ?: f); + start = ftell(of ? of : f); if (c == EOF) break; @@ -312,7 +312,7 @@ struct plist *parse_patch(FILE *f, FILE *of, int *np) else pos = target2; } - end = ftell(of ?: f); + end = ftell(of ? of : f); if (pos > target2) end -= (pos - target2) - 1; plist = patch_add_file(plist, np, diff --git a/vpatch.c b/vpatch.c index b735f36..2b9bd29 100644 --- a/vpatch.c +++ b/vpatch.c @@ -1790,7 +1790,7 @@ static int merge_window(struct plist *p, FILE *f, int reverse, int replace, ci.merger, 0, &p->wiggles); p->chunks = p->conflicts; save_merge(fm, fb, fa, ci.merger, - p->outfile ?: p->file, + p->outfile ? p->outfile : p->file, p->outfile ? 0 : !p->is_merge); } if (!just_diff) -- 2.39.5