]> git.lizzy.rs Git - bspwm.git/blobdiff - rule.c
Fix source_these: remove commas
[bspwm.git] / rule.c
diff --git a/rule.c b/rule.c
index 3ec4c45ac8875928a09d2c0d84d208e04218a33e..b669cb68601d273d89e233ebd5084e54767eb6be 100644 (file)
--- a/rule.c
+++ b/rule.c
@@ -1,16 +1,15 @@
-/*
- * Copyright (c) 2012-2014, Bastien Dejean
+/* Copyright (c) 2012-2014, Bastien Dejean
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice, this
  *    list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright notice,
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -21,7 +20,7 @@
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those
  * of the authors and should not be interpreted as representing official policies,
  * either expressed or implied, of the FreeBSD Project.
@@ -283,6 +282,8 @@ void parse_key_value(char *key, char *value, rule_consequence_t *csq)
                snprintf(csq->desktop_desc, sizeof(csq->desktop_desc), "%s", value);
        } else if (streq("window", key)) {
                snprintf(csq->node_desc, sizeof(csq->node_desc), "%s", value);
+       } else if (streq("split_dir", key)) {
+               snprintf(csq->split_dir, sizeof(csq->split_dir), "%s", value);
        } else if (parse_bool(value, &v)) {
                if (streq("floating", key))
                        csq->floating = v;
@@ -295,7 +296,6 @@ void parse_key_value(char *key, char *value, rule_consequence_t *csq)
                SETCSQ(sticky)
                SETCSQ(private)
                SETCSQ(center)
-               SETCSQ(lower)
                SETCSQ(follow)
                SETCSQ(manage)
                SETCSQ(focus)
@@ -303,13 +303,11 @@ void parse_key_value(char *key, char *value, rule_consequence_t *csq)
        }
 }
 
-void list_rules(char *pattern, char *rsp)
+void list_rules(char *pattern, FILE *rsp)
 {
-       char line[MAXLEN];
        for (rule_t *r = rule_head; r != NULL; r = r->next) {
                if (pattern != NULL && !streq(pattern, r->cause))
                        continue;
-               snprintf(line, sizeof(line), "%s => %s\n", r->cause, r->effect);
-               strncat(rsp, line, REMLEN(rsp));
+               fprintf(rsp, "%s => %s\n", r->cause, r->effect);
        }
 }