diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-06-21 00:27:16 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-22 00:59:28 +0000 |
commit | 7e5428c5eadf5068dae305575a105bd61a84cb5d (patch) | |
tree | 6f1c67cd5b099917f7e0c67463e1b5b37d518c12 /regexec.c | |
parent | 274c75005985b277dc1c9506e79e73f65d8cd586 (diff) | |
download | perl-7e5428c5eadf5068dae305575a105bd61a84cb5d.tar.gz |
Zero-length matching bug
Message-Id: <199806210827.EAA26322@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@1185
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -697,7 +697,7 @@ regtry(regexp *prog, char *startpos) } } REGCP_SET; - if (regmatch(prog->program + 1) && reginput >= regtill) { + if (regmatch(prog->program + 1)) { prog->startp[0] = startpos; prog->endp[0] = reginput; return 1; @@ -1504,8 +1504,11 @@ regmatch(regnode *prog) } sayNO; break; - case SUCCEED: case END: + if (locinput < regtill) + sayNO; /* Cannot match: too short. */ + /* Fall through */ + case SUCCEED: reginput = locinput; /* put where regtry can find it */ sayYES; /* Success! */ case SUSPEND: |