[PATCH] Track minimum string length in string trees

Keep track of the shortest string in our string trees. This info is helpful
for string completion.

diff -urN b/common/shell.c head/common/shell.c
--- b/common/shell.c	2006-02-18 11:34:50.000000000 +1030
+++ head/common/shell.c	2006-02-15 14:47:30.000000000 +1030
@@ -126,6 +126,8 @@
     len = strlen(node->string);
     if (len > root->maxlen)
 	root->maxlen = len;
+    if (len < root->minlen)
+	root->minlen = len;
     rb_link_node(&node->node, parent, p);
     rb_insert_color(&node->node, &root->root);
 
diff -urN b/include/shell.h head/include/shell.h
--- b/include/shell.h	2006-01-22 12:17:30.000000000 +1030
+++ head/include/shell.h	2006-02-15 12:22:41.000000000 +1030
@@ -31,10 +31,11 @@
 struct rb_string_root {
     unsigned int entries;
     unsigned int maxlen;
+    unsigned int minlen;
     struct rb_root root;
 };
 
-#define RB_STRING_ROOT (struct rb_string_root) { 0, 0, RB_ROOT }
+#define RB_STRING_ROOT (struct rb_string_root) { 0, 0, -1, RB_ROOT }
 
 /*
  * String node is simply an rb_tree node using the string as the index (and
