Skip to content

Commit

Permalink
fix(regexp): fix the global matching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Water-Melon committed May 7, 2024
1 parent c7eea94 commit dadd3b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mln_regexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ MLN_FUNC(, int, mln_reg_match, \
++p, --len;
goto again;
}
return -1;
return mln_array_nelts(matches);
}
if (len - ret > 0) {
if ((s = (mln_string_t *)mln_array_push(matches)) == NULL) {
Expand All @@ -908,10 +908,8 @@ MLN_FUNC(, int, mln_reg_match, \
len = ret;
goto again;
}

return mln_array_nelts(matches);
}
return 0;
return mln_array_nelts(matches);
})

MLN_FUNC(, int, mln_reg_equal, (mln_string_t *exp, mln_string_t *text), (exp, text), {
Expand Down

0 comments on commit dadd3b9

Please sign in to comment.