Module Name:    src
Committed By:   mbalmer
Date:           Thu Oct 17 08:07:54 UTC 2013

Modified Files:
        src/libexec/httpd: lua-bozo.c

Log Message:
fold long line in a readable way; pass nil as query table if reading form data 
fails


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/libexec/httpd/lua-bozo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/lua-bozo.c
diff -u src/libexec/httpd/lua-bozo.c:1.4 src/libexec/httpd/lua-bozo.c:1.5
--- src/libexec/httpd/lua-bozo.c:1.4	Thu Oct 17 07:54:19 2013
+++ src/libexec/httpd/lua-bozo.c	Thu Oct 17 08:07:54 2013
@@ -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 <m...@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);
 					}

Reply via email to