Message ID | Z81ikFIDPKfySXN2@gondor.apana.org.au (mailing list archive) |
---|---|
State | Under Review |
Delegated to: | Herbert Xu |
Headers | show |
Series | expand: Add bypass for literal "]" in expandmeta | expand |
... > Fix performance regression for idiomatic "[ ... ]" expression by > adding a bypass for a literal "]" in pathname expansion. > > Reported-by: Jan Pechanec <Jan.Pechanec@oracle.com> > Fixes: 8d0eca2d9fb5 ("expand: Rewrite expmeta meta detection") > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> > > 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
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;