1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-03 22:27:13 +02:00

24708: Misc/globtests, Src/pattern.c, Test/D02glob.ztst:

fix backtracking problem in (#c) pattern
This commit is contained in:
Peter Stephenson 2008-03-30 22:14:22 +00:00
parent af92f874e1
commit 7389a42d17
4 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-03-30 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 24708: Misc/globtests, Src/pattern.c, Test/D02glob.ztst:
(#c) extended globbing flag didn't backtrack properly on
failure of the remaining pattern after the repeated pattern.
2008-03-28 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 24777: Src/Zle/complist.c: bug clearing a list when

View File

@ -192,5 +192,20 @@ t ZX Z(|)(#c1)X
t froofroo (fro(#c2))(#c2)
f froofroofroo (fro(#c2))(#c2)
f froofro (fro(#c2))(#c2)
t ax ?(#c1,2)x
t ax ?(#c1,)x
t ax ?(#c0,1)x
f ax ?(#c0,0)x
f ax ?(#c2,)x
t aa a(#c1,2)a
t aa a(#c1,)a
t aa a(#c0,1)a
f aa a(#c0,0)a
f aa a(#c2,)a
t test.zsh *.?(#c1)sh
t test.bash *.?(#c2)sh
t test.bash *.?(#c1,2)sh
t test.bash *.?(#c1,)sh
t test.zsh *.?(#c1,)sh
EOT
print "$failed tests failed."

View File

@ -2969,9 +2969,11 @@ patmatch(Upat prog)
scan[P_CT_PTR].p = (unsigned char *)patinput;
if (max < 0 || cur < max) {
char *patinput_thistime = patinput;
scan[P_CT_CURRENT].l = cur + 1;
if (patmatch(scan + P_CT_OPERAND))
return 1;
patinput = patinput_thistime;
}
if (cur < min)
return 0;

View File

@ -187,6 +187,21 @@
>0: [[ froofroo = (fro(#c2))(#c2) ]]
>1: [[ froofroofroo = (fro(#c2))(#c2) ]]
>1: [[ froofro = (fro(#c2))(#c2) ]]
>0: [[ ax = ?(#c1,2)x ]]
>0: [[ ax = ?(#c1,)x ]]
>0: [[ ax = ?(#c0,1)x ]]
>1: [[ ax = ?(#c0,0)x ]]
>1: [[ ax = ?(#c2,)x ]]
>0: [[ aa = a(#c1,2)a ]]
>0: [[ aa = a(#c1,)a ]]
>0: [[ aa = a(#c0,1)a ]]
>1: [[ aa = a(#c0,0)a ]]
>1: [[ aa = a(#c2,)a ]]
>0: [[ test.zsh = *.?(#c1)sh ]]
>0: [[ test.bash = *.?(#c2)sh ]]
>0: [[ test.bash = *.?(#c1,2)sh ]]
>0: [[ test.bash = *.?(#c1,)sh ]]
>0: [[ test.zsh = *.?(#c1,)sh ]]
>0 tests failed.
globtest globtests.ksh