... > Fix performance regression for idiomatic "[ ... ]" expression by > adding a bypass for a literal "]" in pathname expansion. > > Reported-by: Jan Pechanec <Jan.Pechanec@xxxxxxxxxx> > Fixes: 8d0eca2d9fb5 ("expand: Rewrite expmeta meta detection") > Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > > diff --git a/src/expand.c b/src/expand.c > index 7a30648..5114646 100644 > --- a/src/expand.c > +++ b/src/expand.c > @@ -1555,7 +1555,7 @@ expandmeta(struct strlist *str) > > if (fflag) > goto nometa; > - if (!strpbrk(str->text, "*?]")) > + if (!strpbrk(str->text, "*?]") || !memcmp(str->text, "]", 2)) > goto nometa; > savelastp = exparg.lastp; Hi Herbert, thank you, this seems to fix the regression reported. I just applied the patch and succesfully re-tested. Regards, Jan -- Jan Pechanec <jan.pechanec@xxxxxxxxxx>