]> granicus.if.org Git - apache/commitdiff
alphabetize writable lua properties and use strcmp() for the oddball that's
authorEric Covener <covener@apache.org>
Sun, 30 Oct 2011 14:19:45 +0000 (14:19 +0000)
committerEric Covener <covener@apache.org>
Sun, 30 Oct 2011 14:19:45 +0000 (14:19 +0000)
just testing quality of "user".

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

modules/lua/lua_request.c

index 3f33c209aac16c2e5dd8cd649a5dcc52ea843649..44334bc92b47f2633a36bac6f3c307778db6b2af 100644 (file)
@@ -462,9 +462,10 @@ static int req_newindex(lua_State *L)
     /* const char* key = luaL_checkstring(L, -2); */
     request_rec *r = ap_lua_check_request_rec(L, 1);
     key = luaL_checkstring(L, 2);
-    if (0 == strcmp("status", key)) {
-        int code = luaL_checkinteger(L, 3);
-        r->status = code;
+
+    if (0 == strcmp("args", key)) {
+        const char *value = luaL_checkstring(L, 3);
+        r->args = apr_pstrdup(r->pool, value);
         return 0;
     }
 
@@ -480,19 +481,19 @@ static int req_newindex(lua_State *L)
         return 0;
     }
 
-    if (0 == strcmp("uri", key)) {
-        const char *value = luaL_checkstring(L, 3);
-        r->uri = apr_pstrdup(r->pool, value);
+    if (0 == strcmp("status", key)) {
+        int code = luaL_checkinteger(L, 3);
+        r->status = code;
         return 0;
     }
 
-    if (0 == strcmp("args", key)) {
+    if (0 == strcmp("uri", key)) {
         const char *value = luaL_checkstring(L, 3);
-        r->args = apr_pstrdup(r->pool, value);
+        r->uri = apr_pstrdup(r->pool, value);
         return 0;
     }
 
-    if (0 == apr_strnatcmp("user", key)) {
+    if (0 == strcmp("user", key)) {
         const char *value = luaL_checkstring(L, 3);
         r->user = apr_pstrdup(r->pool, value);
         return 0;