Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.14-4) unstable; urgency=medium
 .
   * Version_2_6_15pre3
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2023-02-14

--- gcl-2.6.14.orig/git.tag
+++ gcl-2.6.14/git.tag
@@ -1 +1 @@
-"Version_2_6_15pre2"
+"Version_2_6_15pre3"
--- gcl-2.6.14.orig/o/gcl_readline.d
+++ gcl-2.6.14/o/gcl_readline.d
@@ -117,14 +117,14 @@ rl_completion_words(const char *text, in
     wtext=*wtext==':' ? wtext+1 : wtext;
     len=strlen(wtext);
     tp=package;
-    i=0;
     base=internal ? tp->p.p_internal : tp->p.p_external;
     size=internal ? tp->p.p_internal_size : tp->p.p_external_size;
+    i=0;
     l=base[i];
 
   }
 
-  while (tp && tp != Cnil) {
+  while (tp != OBJNULL && tp != Cnil) {
 
     while (1) {
       while (type_of(l)==t_cons) {
@@ -147,17 +147,17 @@ rl_completion_words(const char *text, in
 	  return c;
 	}
       }
-      if (++i==size)
+      if (++i>=size)
 	break;
       l=base[i];
     }      
 
     tp=use->c.c_car;
     use=use->c.c_cdr;
-    base=internal ? tp->p.p_internal : tp->p.p_external;
-    size=internal ? tp->p.p_internal_size : tp->p.p_external_size;
+    base=tp==Cnil ? NULL : (internal ? tp->p.p_internal : tp->p.p_external);
+    size=tp==Cnil ? 0    : (internal ? tp->p.p_internal_size : tp->p.p_external_size);
     i=0;
-    l=base[i];
+    l=base==NULL ? Cnil : base[i];
 
   }
 
