httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1434065 - /httpd/httpd/trunk/modules/lua/lua_request.c
Date Wed, 16 Jan 2013 18:00:04 GMT
Author: humbedooh
Date: Wed Jan 16 18:00:04 2013
New Revision: 1434065

URL: http://svn.apache.org/viewvc?rev=1434065&view=rev
Log:
If r:regex does not match, only return 'false', don't try to create error messages, because
there should not be any - it's either match or no match here at this point.

Modified:
    httpd/httpd/trunk/modules/lua/lua_request.c

Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1434065&r1=1434064&r2=1434065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Wed Jan 16 18:00:04 2013
@@ -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);



Mime
View raw message