65 lines
2.0 KiB
Diff
65 lines
2.0 KiB
Diff
commit 844157986de0e1fb9a50c7674eaae527eec23349
|
|
Author: Reginald Kennedy <rk@rejii.com>
|
|
Date: Sat Nov 16 23:21:15 2013 +0800
|
|
|
|
Fix 'bind[] = ...' not unbinding as expected.
|
|
|
|
Fixes #23
|
|
|
|
diff --git a/spectrwm.c b/spectrwm.c
|
|
index 34a49be..251b746 100644
|
|
--- a/spectrwm.c
|
|
+++ b/spectrwm.c
|
|
@@ -6398,6 +6398,9 @@ setconfspawn(const char *selector, const char *value, int flags)
|
|
{
|
|
char *args;
|
|
|
|
+ if (selector == NULL || strlen(selector) == 0)
|
|
+ return (1);
|
|
+
|
|
args = expand_tilde(value);
|
|
|
|
DNPRINTF(SWM_D_SPAWN, "setconfspawn: [%s] [%s]\n", selector, args);
|
|
@@ -6646,8 +6649,9 @@ setconfbinding(const char *selector, const char *value, int flags)
|
|
/* suppress unused warning since var is needed */
|
|
(void)flags;
|
|
|
|
- DNPRINTF(SWM_D_KEY, "setconfbinding: enter\n");
|
|
- if (selector == NULL) {
|
|
+ DNPRINTF(SWM_D_KEY, "setconfbinding: enter selector: [%s], "
|
|
+ "value: [%s]\n", selector, value);
|
|
+ if (selector == NULL || strlen(selector) == 0) {
|
|
DNPRINTF(SWM_D_KEY, "setconfbinding: unbind %s\n", value);
|
|
if (parsekeys(value, mod_key, &mod, &ks) == 0) {
|
|
kfid = KF_INVALID;
|
|
@@ -7164,7 +7168,7 @@ setconfquirk(const char *selector, const char *value, int flags)
|
|
/* suppress unused warning since var is needed */
|
|
(void)flags;
|
|
|
|
- if (selector == NULL)
|
|
+ if (selector == NULL || strlen(selector) == 0)
|
|
return (0);
|
|
|
|
if ((str = strdup(selector)) == NULL)
|
|
@@ -7277,9 +7281,6 @@ setconfvalue(const char *selector, const char *value, int flags)
|
|
int i, ws_id, num_screens;
|
|
char *b, *str;
|
|
|
|
- /* suppress unused warning since var is needed */
|
|
- (void)selector;
|
|
-
|
|
switch (flags) {
|
|
case SWM_S_BAR_ACTION:
|
|
free(bar_argv[0]);
|
|
@@ -7519,7 +7520,9 @@ setconfmodkey(const char *selector, const char *value, int flags)
|
|
int
|
|
setconfcolor(const char *selector, const char *value, int flags)
|
|
{
|
|
- setscreencolor(value, ((selector == NULL)?-1:atoi(selector)), flags);
|
|
+ setscreencolor(value,
|
|
+ (selector == NULL || strlen(selector) == 0) ? -1 : atoi(selector),
|
|
+ flags);
|
|
return (0);
|
|
}
|
|
|