mirror of
https://github.com/zsh-users/zsh
synced 2024-09-29 20:54:53 +00:00
24708: Misc/globtests, Src/pattern.c, Test/D02glob.ztst:
fix backtracking problem in (#c) pattern
This commit is contained in:
parent
af92f874e1
commit
7389a42d17
|
@ -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
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue