summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-03-18 15:35:09 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-03-18 15:36:17 +0100
commit9d0b3de603b0ed965c1ec40433b9bf89918f67b8 (patch)
tree5f8436498ac8d93bdfaa0a6d286c4a0df3c7a861
parent85e8bf57e16517b07b2d175d1a17e701d8791ec1 (diff)
lua: fix query string handling, the QUERY_STRING environment variable must not contain the leading question mark
-rw-r--r--lua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua.c b/lua.c
index c6f27e9..55efaaa 100644
--- a/lua.c
+++ b/lua.c
@@ -218,7 +218,8 @@ static void lua_main(struct client *cl, struct path_info *pi, char *url)
path_len = strlen(url);
str = strchr(url, '?');
if (str) {
- pi->query = str;
+ if (*(str + 1))
+ pi->query = str + 1;
path_len = str - url;
}
if (path_len > prefix_len) {