]> granicus.if.org Git - apache/commitdiff
If r:regex does not match, only return 'false', don't try to create error messages...
authorDaniel Gruno <humbedooh@apache.org>
Wed, 16 Jan 2013 18:00:04 +0000 (18:00 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Wed, 16 Jan 2013 18:00:04 +0000 (18:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1434065 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index 7020c2d1d967270cd1e8086e58607546d8a01b0a..c1267f3cbd50e407b0a04a32bb29e5626cee457c 100644 (file)
@@ -920,13 +920,11 @@ static int lua_ap_regex(lua_State *L)
     }
 
     rv = ap_regexec(&regex, source, AP_MAX_REG_MATCH, matches, 0);
-    if (rv < 0) {
+    if (rv == AP_REG_NOMATCH) {
         lua_pushboolean(L, 0);
-        err = apr_palloc(r->pool, 256);
-        ap_regerror(rv, &regex, err, 256);
-        lua_pushstring(L, err);
-        return 2;
+        return 1;
     }
+    
     lua_newtable(L);
     for (i = 0; i < regex.re_nsub; i++) {
         lua_pushinteger(L, i);