1. mirror
  2. Apache HTTP Server

Commits

Daniel Gruno  committed b471add

r:regex was not returning the last captured group, as we were one off on how many captures to push to the table.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@144560913f79535-47bb-0310-9956-ffa450edef68

  • Participants
  • Parent commits 11718a1
  • Branches trunk

Comments (0)

Files changed (1)

File modules/lua/lua_request.c

View file
     *source;
     char           *err;
     ap_regex_t regex;
-    ap_regmatch_t matches[AP_MAX_REG_MATCH];
+    ap_regmatch_t matches[AP_MAX_REG_MATCH+1];
 
     luaL_checktype(L, 1, LUA_TUSERDATA);
     luaL_checktype(L, 2, LUA_TSTRING);
     }
     
     lua_newtable(L);
-    for (i = 0; i < regex.re_nsub; i++) {
+    for (i = 0; i <= regex.re_nsub; i++) {
         lua_pushinteger(L, i);
         if (matches[i].rm_so >= 0 && matches[i].rm_eo >= 0)
             lua_pushstring(L,