[sword-devel] Bug in diatheke search output

Fred Gilham fmgilham at gmail.com
Tue Apr 7 11:42:26 EDT 2026


Hello,

The search output for diatheke seems to have a minor bug. Searching as follows

./diatheke -b KJV -s lucene -f plain -k possible

produces the following output.

Entries containing "possible"-- Romans 12:18Hebrews 10:4 ; Luke 18:27 ; Mark 9:23 ; Matthew 19:26 ; Mark 13:22 ; Mark 14:35 ; Acts 2:24 ; Matthew 24:24 ; Mark 10:27 ; Mark 14:36 ; Galatians 4:15 ; Acts 27:39 ; Acts 20:16 ; Matthew 26:39 ;  -- 15 matches total (KJV)


I did a patch:

--- corediatheke.cpp.orig       2026-03-18 20:01:01.033744516 -0700
+++ corediatheke.cpp    2026-03-18 09:41:42.073441691 -0700
@@ -227,12 +227,12 @@
                if (listkey.getCount()) {
                        for (listkey = TOP; !listkey.popError(); listkey++) {
                                if (!listkey.popError()) {
+                                       if (first) first = false;
+                                       else *output << " ; ";
                                        if (outputformat == FMT_CGI) *output << "<entry>";
                                        *output << listkey.getText();
                                        if (outputformat == FMT_CGI) *output << "</entry>";
                                }
-                               if (first) first = false;
-                               else *output << " ; ";
                        }
                        *output << " -- ";
 

After this the output is correct:

./diatheke -b KJV -s lucene -f plain -k possible

Entries containing "possible"-- Romans 12:18 ; Hebrews 10:4 ; Luke 18:27 ; Mark 9:23 ; Matthew 19:26 ; Mark 13:22 ; Mark 14:35 ; Acts 2:24 ; Matthew 24:24 ; Mark 10:27 ; Mark 14:36 ; Galatians 4:15 ; Acts 27:39 ; Acts 20:16 ; Matthew 26:39 -- 15 matches total (KJV)



-- 
Pastor Fred Gilham                                    fmgilham at gmail.com
...Please don't assume Lisp is only useful for Animation and Graphics,
AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor
applications, Expert Systems, Finance, Intelligent Agents, Knowledge
Management, Mechanical CAD, Modeling and Simulation, Natural Language,
Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web
Authoring just because these are the only things they happened to
list.                                                  -- Kent Pitman


More information about the sword-devel mailing list