diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-02-05 14:39:39 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-02-05 14:39:39 +0000 |
| commit | 55f160fb07eaee977c89bdee7bdd83f4d21f5adf (patch) | |
| tree | 097b96215ca38f4bc668a63ad80642eea39bf374 /usr.bin/diff | |
| parent | a689bfa4e25af8307709dc12f75b0e02a65abf18 (diff) | |
Diffstat (limited to 'usr.bin/diff')
| -rw-r--r-- | usr.bin/diff/diffreg_new.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/diff/diffreg_new.c b/usr.bin/diff/diffreg_new.c index f29e4ad8b9ed..29882923cd0e 100644 --- a/usr.bin/diff/diffreg_new.c +++ b/usr.bin/diff/diffreg_new.c @@ -158,6 +158,7 @@ diffreg_new(char *file1, char *file2, int flags, int capsicum) const struct diff_config *cfg; enum diffreg_algo algo; cap_rights_t rights_ro; + int ret; algo = DIFFREG_ALGO_MYERS_THEN_MYERS_DIVIDE; @@ -219,12 +220,20 @@ diffreg_new(char *file1, char *file2, int flags, int capsicum) if (flags & D_PROTOTYPE) diff_flags |= DIFF_FLAG_SHOW_PROTOTYPES; - if (diff_atomize_file(&left, cfg, f1, (uint8_t *)str1, st1.st_size, diff_flags)) { + ret = diff_atomize_file(&left, cfg, f1, (uint8_t *)str1, st1.st_size, + diff_flags); + if (ret != DIFF_RC_OK) { + warnc(ret, "%s", file1); rc = D_ERROR; + status |= 2; goto done; } - if (diff_atomize_file(&right, cfg, f2, (uint8_t *)str2, st2.st_size, diff_flags)) { + ret = diff_atomize_file(&right, cfg, f2, (uint8_t *)str2, st2.st_size, + diff_flags); + if (ret != DIFF_RC_OK) { + warnc(ret, "%s", file2); rc = D_ERROR; + status |= 2; goto done; } |
