]> granicus.if.org Git - apache/commitdiff
mod_lua.c:189:13: error: ISO C90 forbids mixed declarations and code [-Werror=declara...
authorJeff Trawick <trawick@apache.org>
Wed, 1 Aug 2012 16:41:04 +0000 (16:41 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 1 Aug 2012 16:41:04 +0000 (16:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1368109 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/mod_lua.c

index 460f8e2d371a084728e238fcb0aebb1a65d656e2..a16b1ba06d383b3a829081107c5c95017c493d52 100644 (file)
@@ -180,13 +180,13 @@ static const char* ap_lua_interpolate_string(apr_pool_t* pool, const char* strin
     y = 0;
     for (x=0; x < srclen; x++) {
         if (string[x] == '$' && x != srclen-1 && string[x+1] >= '0' && string[x+1] <= '9') {
+            int v = *(string+x+1) - '0';
             if (x-y > 0) {
                 stringBetween = apr_pstrndup(pool, string+y, x-y);
             }
             else {
                 stringBetween = "";
             }
-            int v = *(string+x+1) - '0';
             ret = apr_pstrcat(pool, ret, stringBetween, values[v], NULL);
             y = ++x+1;
         }