X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/352f37e2de014cc666d8323167aa887ddf529cdc..256c29a27ba79677a78bc676a3cc73ee1aad2d68:/trie.c diff --git a/trie.c b/trie.c index acce8be..0466a34 100644 --- a/trie.c +++ b/trie.c @@ -617,3 +617,12 @@ off_t trie_get_index_offset(const void *t) { return ((const struct trie_header *)t)->indexroot; } + +void make_successor(char *pathbuf) +{ + int len = strlen(pathbuf); + if (len > 0 && pathbuf[len-1] == pathsep) + len--; + pathbuf[len] = '\001'; + pathbuf[len+1] = '\0'; +}