From 31eed98fe9f5d69695d9b5bc2702cbb0c78af0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 23 May 2024 05:02:15 +0200 Subject: [PATCH 2/2] Warn if the atomizer detected truncation. --- diff/diff.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/diff/diff.c b/diff/diff.c index eded416..119ca79 100644 --- a/diff/diff.c +++ b/diff/diff.c @@ -229,9 +229,13 @@ diffreg(char *file1, char *file2, enum diffreg_algo algo, bool force_text, rc = diff_atomize_file(&left, cfg, f1, str1, st1.st_size, diff_flags); if (rc) goto done; + if (left.atomizer_flags & DIFF_ATOMIZER_FILE_TRUNCATED) + warnx("%s truncated", file1); rc = diff_atomize_file(&right, cfg, f2, str2, st2.st_size, diff_flags); if (rc) goto done; + if (right.atomizer_flags & DIFF_ATOMIZER_FILE_TRUNCATED) + warnx("%s truncated", file2); result = diff_main(cfg, &left, &right); #if 0 -- 2.45.1