@@ -473,7 +473,7 @@ plist[plistidx++] = npc; \
473473
474474#define onclist (nn ) \
475475
476- #define endnlist() if (*npc == MATCH) nmatch =1 ; \
476+ #define endnlist() if (*npc == MATCH) nmatch =sp ; \
477477
478478#define endclist () \
479479
@@ -571,8 +571,8 @@ int re_pikevm(rcode *prog, const char *s, const char **subp, int nsubp)
571571{
572572int rsubsize = sizeof (rsub )+ (sizeof (char * )* nsubp );
573573int i ,j ,c ,suboff = rsubsize ,* npc ,osubp = nsubp * sizeof (char * );
574- int clistidx = 0 ,nlistidx ,plistidx , nmatch ;
575- const char * sp = s ,* _sp = s ;
574+ int clistidx = 0 ,nlistidx ,plistidx ;
575+ const char * sp = s ,* _sp = s , * nmatch = NULL ;
576576int * insts = prog -> insts ;
577577int * pcs [prog -> splits ],* plist [prog -> splits ];
578578rsub * subs [prog -> splits ];
@@ -584,7 +584,7 @@ int re_pikevm(rcode *prog, const char *s, const char **subp, int nsubp)
584584for (;;sp = _sp ) {
585585uc_len (i ,sp )uc_code (c ,sp )
586586_sp = sp + i ;
587- nlistidx = 0 ;plistidx = 0 ;nmatch = 0 ;
587+ nlistidx = 0 ;plistidx = 0 ;
588588for (i = 0 ;i < clistidx ;i ++ ) {
589589npc = clist [i ].pc ;
590590nsub = clist [i ].sub ;
@@ -594,7 +594,7 @@ int re_pikevm(rcode *prog, const char *s, const char **subp, int nsubp)
594594break ;
595595case ANY :
596596addthread :
597- if (nmatch )
597+ if (nmatch == sp )
598598break ;
599599addthread (2 ,nlist ,nlistidx )
600600case CLASS :