]> git.lizzy.rs Git - bspwm.git/blobdiff - rule.c
Update TODO regarding pointer grabbing
[bspwm.git] / rule.c
diff --git a/rule.c b/rule.c
index 0b0e6bf7f416aceb2a7577b83230c1c0179a74c3..60bd0fc5a63678aca193d31287ae27ea8eb07f19 100644 (file)
--- a/rule.c
+++ b/rule.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, Bastien Dejean
+/* Copyright (c) 2012, Bastien Dejean
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * 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.
  */
 
 #include <stdio.h>
@@ -97,7 +93,7 @@ bool remove_rule_by_index(int idx)
 rule_consequence_t *make_rule_conquence(void)
 {
        rule_consequence_t *rc = calloc(1, sizeof(rule_consequence_t));
-       rc->manage = rc->focus = true;
+       rc->manage = rc->focus = rc->border = true;
        return rc;
 }
 
@@ -299,17 +295,16 @@ void parse_key_value(char *key, char *value, rule_consequence_t *csq)
                SETCSQ(follow)
                SETCSQ(manage)
                SETCSQ(focus)
+               SETCSQ(border)
 #undef SETCSQ
        }
 }
 
-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);
        }
 }