this reduces the function frame by sharing more state in the recursion,
and produces a slightly smaller object file with GCC 10.3 on x86_64:
@@ -22,7 +22,7 @@ Notes:
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/src/regex/glob.c b/src/regex/glob.c
-index a490644653a9..d8377f35d7d3 100644
+index 87bae084fb27..3194eea74a75 100644
--- a/src/regex/glob.c
+++ b/src/regex/glob.c
@@ -32,10 +32,16 @@ static int append(struct match **tail, const char *name,
size_t len, int mark)
@@ -144,5 +144,5 @@ index a490644653a9..d8377f35d7d3 100644
}