gbranden pushed a commit to branch master
in repository groff.

commit 879108fbd1fb02a71a5419485384da7f3b7eab9f
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 17 20:11:08 2026 -0500

    [refer]: Regression-test Savannah #68682.
    
    * src/preproc/refer/tests/check-index-file-validity.sh: Do it.
    
    Test fails at this commit.
---
 ChangeLog                                          |  6 ++++++
 .../refer/tests/check-index-file-validity.sh       | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 50989842c..79d2676d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-09-17  G. Branden Robinson <[email protected]>
+
+       [refer]: Regression-test Savannah #68682.
+
+       * src/preproc/refer/tests/check-index-file-validity.sh: Do it.
+
 2026-09-10  G. Branden Robinson <[email protected]>
 
        [libbib]: Fix mismatched memory allocation/deallocation
diff --git a/src/preproc/refer/tests/check-index-file-validity.sh 
b/src/preproc/refer/tests/check-index-file-validity.sh
index 4c452abfc..c601173fc 100755
--- a/src/preproc/refer/tests/check-index-file-validity.sh
+++ b/src/preproc/refer/tests/check-index-file-validity.sh
@@ -106,6 +106,28 @@ printf '\0' | dd of="$REFER".i bs=1 seek=4044 conv=notrunc
 echo "checking behavior when index file string pool corrupt" >&2
 "$lkbib" Test 2>&1 > /dev/null | grep -q 'error.*corrupt string' || wail
 
+# Regression-test Savannah #68682.
+
+REFER="$sandbox_dir"/file-name-index.bib
+echo '%A Test' > "$REFER"
+
+if ! "$indxbib" -c "$common_words_file" "$REFER"
+then
+    echo "cannot generate index for bibliography file; skipping" >&2
+    exit 77 # skip
+fi
+
+# Corrupt the bibliography file's index number.  Thanks to Pavol
+# Sloboda.
+#
+# dash's built-in printf doesn't support \x or \u escapes, so likely
+# other shells don't either, and expecting one that does to be in the
+# $PATH seems optimistic.
+printf '\377\377\377\377' | dd of="$REFER".i bs=1 seek=36 conv=notrunc
+echo "checking behavior when index file name index number corrupt" >&2
+"$lkbib" Test 2>&1 > /dev/null | grep -q 'invalid.*file name index' \
+    || wail
+
 # We need `-f` because "little-schemer.bib" gets mode 444 in a "make
 # distcheck" build.
 rm -rf "$sandbox_dir"

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to