gbranden pushed a commit to branch master
in repository groff.

commit 5478fe37f1fe28bb575afef267e5c0234c8c038b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 10 03:10:56 2026 -0500

    [libbib]: Improve error diagnostic.
    
    * src/libs/libbib/index.cpp (index_search_item::load): ...to communicate
      the consequences of a corrupt index file: it gets ignored, meaning
      that its bibliographic (plain text) file counterpart is processed
      instead.
---
 ChangeLog                 | 7 +++++++
 src/libs/libbib/index.cpp | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b24866354..248f8c9e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-09-10  G. Branden Robinson <[email protected]>
+
+       * src/libs/libbib/index.cpp (index_search_item::load): Improve
+       error diagnostic to communicate the consequences of a corrupt
+       index file: it gets ignored, meaning that its bibliographic
+       {plain text} file counterpart is processed instead.
+
 2026-09-03  G. Branden Robinson <[email protected]>
 
        * tmac/s.tmac (KF): Break the line just as `KS` does.
diff --git a/src/libs/libbib/index.cpp b/src/libs/libbib/index.cpp
index ee0a7d5d9..b783ebf1e 100644
--- a/src/libs/libbib/index.cpp
+++ b/src/libs/libbib/index.cpp
@@ -253,9 +253,10 @@ bool index_search_item::load(int fd)
   const char *problem = check_header(&header, size);
   if (problem != 0 /* nullptr */) {
     if (do_verify)
-      error("corrupt header in index file '%1': %2", name, problem);
+      error("ignoring index file '%1' due to corrupt header: %2", name,
+           problem);
     else
-      error("corrupt header in index file '%1'", name);
+      error("ignoring index file '%1' due to corrupt header", name);
     return false;
   }
   tags = (tag *)(addr + sizeof(header));

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

Reply via email to