]> code.delx.au - spectrwm/commitdiff
Remove setquirk error; just ignore when attempting to set quirk to NONE.
authorReginald Kennedy <rk@rejii.com>
Sun, 26 Aug 2012 12:39:47 +0000 (20:39 +0800)
committerReginald Kennedy <rk@rejii.com>
Sun, 26 Aug 2012 12:39:51 +0000 (20:39 +0800)
spectrwm.c

index a9ad9135ede06400df1cca720653b80c415715e7..f92cbf07a7c44cd1c164381d13a425b4148af291 100644 (file)
@@ -6173,6 +6173,7 @@ setquirk(const char *class, const char *name, unsigned long quirk)
        DNPRINTF(SWM_D_QUIRK, "setquirk: enter %s:%s [%lu]\n", class, name,
           quirk);
 
+       /* Remove/replace existing quirk. */
        TAILQ_FOREACH(qp, &quirks, entry) {
                if (!strcmp(qp->class, class) && !strcmp(qp->name, name)) {
                        if (!quirk)
@@ -6183,12 +6184,11 @@ setquirk(const char *class, const char *name, unsigned long quirk)
                        return;
                }
        }
-       if (!quirk) {
-               warnx("error: setquirk: cannot find class/name combination");
-               return;
-       }
 
-       quirk_insert(class, name, quirk);
+       /* Only insert if quirk is not NONE. */
+       if (quirk)
+               quirk_insert(class, name, quirk);
+
        DNPRINTF(SWM_D_QUIRK, "setquirk: leave\n");
 }