[PATCH 3/4] iwhd: let an attribute have a zero-length value

Jim Meyering jim at meyering.net
Mon Jun 20 16:11:31 UTC 2011


From: Jim Meyering <meyering at redhat.com>

* rest.c (proxy_put_attr): Allow an attribute with zero-length RHS.
* NEWS (New features): Mention it.
---
 NEWS   |    4 ++++
 rest.c |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index fc1cb1b..91665a4 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ iwhd NEWS                                                   -*- outline -*-

 * Noteworthy changes in release ?.? (????-??-??) [?]

+** New features
+
+  iwhd now allows an attribute to have an empty value.
+

 * Noteworthy changes in release 0.96 (2011-06-15) [stable]

diff --git a/rest.c b/rest.c
index d0b4a0b..af8e73a 100644
--- a/rest.c
+++ b/rest.c
@@ -672,9 +672,9 @@ proxy_put_attr (void *cctx, struct MHD_Connection *conn, const char *url,
 		*data_size = 0;
 	}
 	else {
-		if (!ms->pipe.data_ptr) {
+		if (ms->pipe.data_ptr
+		    && (ms->pipe.data_ptr = strdup("")) == NULL)
 			return MHD_NO;
-		}
 		if (is_reserved(ms->attr,reserved_attr)) {
 			struct MHD_Response *resp
 			  = MHD_create_response_from_data(0,NULL,MHD_NO,MHD_NO);
-- 
1.7.6.rc2.295.gb63f3



More information about the iwhd-devel mailing list