now to figure out where is it getting YES from...

>From 8b0a3ca859d5ac7db22fd40e71dee4f0baf485e3 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Wed, 22 Sep 2010 23:01:03 +0200
Subject: [PATCH] Pretty-print for string2index

Turns unhelpful
wmaker: warning: wrong option value for key "NewStyle". Should be one of new, 
old, next
into helpful
wmaker: warning: wrong option value for key "NewStyle". Got "YES", should be 
one of "new", "old", "next"

Signed-off-by: Tamas TEVESZ <[email protected]>
---
 src/defaults.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/defaults.c b/src/defaults.c
index 9333e3b..11bf651 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -1206,10 +1206,14 @@ static int string2index(WMPropList * key, WMPropList * 
val, char *def, WOptionEn
                if (!v->is_alias) {
                        if (buffer[0] != 0)
                                strcat(buffer, ", ");
-                       strcat(buffer, v->string);
+                       snprintf(buffer+strlen(buffer),
+                               sizeof(buffer)-strlen(buffer)-1, "\"%s\"", 
v->string);
                }
        }
-       wwarning(_("wrong option value for key \"%s\". Should be one of %s"), 
WMGetFromPLString(key), buffer);
+       wwarning(_("wrong option value for key \"%s\". Got \"%s\", should be 
one of %s"),
+               WMGetFromPLString(key),
+               WMIsPLString(val) ? WMGetFromPLString(val) : "(unknown)",
+               buffer);
 
        if (def) {
                return string2index(key, val, NULL, values);
-- 
1.7.0.4


-- 
[-]

mkdir /nonexistent
From 8b0a3ca859d5ac7db22fd40e71dee4f0baf485e3 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Wed, 22 Sep 2010 23:01:03 +0200
Subject: [PATCH] Pretty-print for string2index

Turns unhelpful
wmaker: warning: wrong option value for key "NewStyle". Should be one of new, old, next
into helpful
wmaker: warning: wrong option value for key "NewStyle". Got "YES", should be one of "new", "old", "next"

Signed-off-by: Tamas TEVESZ <[email protected]>
---
 src/defaults.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/defaults.c b/src/defaults.c
index 9333e3b..11bf651 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -1206,10 +1206,14 @@ static int string2index(WMPropList * key, WMPropList * val, char *def, WOptionEn
 		if (!v->is_alias) {
 			if (buffer[0] != 0)
 				strcat(buffer, ", ");
-			strcat(buffer, v->string);
+			snprintf(buffer+strlen(buffer),
+				sizeof(buffer)-strlen(buffer)-1, "\"%s\"", v->string);
 		}
 	}
-	wwarning(_("wrong option value for key \"%s\". Should be one of %s"), WMGetFromPLString(key), buffer);
+	wwarning(_("wrong option value for key \"%s\". Got \"%s\", should be one of %s"),
+		WMGetFromPLString(key),
+		WMIsPLString(val) ? WMGetFromPLString(val) : "(unknown)",
+		buffer);
 
 	if (def) {
 		return string2index(key, val, NULL, values);
-- 
1.7.0.4

Reply via email to