<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">[PATCH] Implement STree_Remove

diff -urN a/common/shell.c head/common/shell.c
--- a/common/shell.c	2006-02-19 15:54:31.000000000 +1030
+++ head/common/shell.c	2006-02-19 16:50:47.000000000 +1030
@@ -157,6 +157,12 @@
     return ret;
 }
 
+void
+STree_Remove(struct stree_root *root, struct stree_node *node)
+{
+    rb_erase(&amp;node-&gt;node, &amp;root-&gt;root);
+}
+
 /* STree_MaxMatch helper */
 static int
 ST_node_match(struct rb_node *n, const char *str, int min_match, int max_match)
diff -urN a/include/shell.h head/include/shell.h
--- a/include/shell.h	2006-02-19 15:59:09.000000000 +1030
+++ head/include/shell.h	2006-02-19 16:49:28.000000000 +1030
@@ -60,6 +60,7 @@
 qboolean STree_Insert(struct stree_root *root, struct stree_node *node);
 qboolean STree_InsertAlloc(struct stree_root *root, const char *s,
 			   struct stree_node *n);
+void STree_Remove(struct stree_root *root, struct stree_node *node);
 char *STree_MaxMatch(struct stree_root *root, const char *pfx);
 struct stree_node *STree_Find(struct stree_root *root, const char *s);
 int STree_MaxDepth(struct stree_root *root);
</pre></body></html>