diff options
| author | mbalmer <mbalmer@NetBSD.org> | 2013-10-17 08:07:54 +0000 |
|---|---|---|
| committer | mbalmer <mbalmer@NetBSD.org> | 2013-10-17 08:07:54 +0000 |
| commit | c6ab43fef433c2ef45c86a4cfbdc7b5d241315cc (patch) | |
| tree | 689e88ad3c7743ebee4444a8d3b1fedba9359449 /libexec/httpd | |
| parent | 142b3205879d409bdab55af5e79dc03a8968f378 (diff) | |
fold long line in a readable way; pass nil as query table if reading form data fails
Diffstat (limited to 'libexec/httpd')
| -rw-r--r-- | libexec/httpd/lua-bozo.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libexec/httpd/lua-bozo.c b/libexec/httpd/lua-bozo.c index b567de43651..828599acb86 100644 --- a/libexec/httpd/lua-bozo.c +++ b/libexec/httpd/lua-bozo.c @@ -1,4 +1,4 @@ -/* $NetBSD: lua-bozo.c,v 1.4 2013/10/17 07:54:19 mbalmer Exp $ */ +/* $NetBSD: lua-bozo.c,v 1.5 2013/10/17 08:07:54 mbalmer Exp $ */ /* * Copyright (c) 2013 Marc Balmer <marc@msys.ch> @@ -403,8 +403,8 @@ bozo_process_lua(bozo_httpreq_t *request) headp->h_value); /* Pass the query variables */ - if ((query && *query) || (type && *type - && !strcmp(type, FORM))) { + if ((query && *query) || + (type && *type && !strcmp(type, FORM))) { lua_newtable(map->L); if (query && *query) lua_decode_query(map->L, query); @@ -420,6 +420,9 @@ bozo_process_lua(bozo_httpreq_t *request) content[n] = '\0'; lua_decode_query(map->L, content); + } else { + lua_pop(map->L, 1); + lua_pushnil(map->L); } free(content); } |
