]> git.sur5r.net Git - i3/i3/blobdiff - src/config_parser.c
Merge branch 'master' into next
[i3/i3] / src / config_parser.c
index 7391896bf4ef391023b5e17834ead257085f92f7..cb21dae7c9c058ad601eaf445470c1f67223a0ec 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * config_parser.c: hand-written parser to parse configuration directives.
  *
@@ -159,7 +159,7 @@ static const char *get_string(const char *identifier) {
     return NULL;
 }
 
-static const long get_long(const char *identifier) {
+static long get_long(const char *identifier) {
     for (int c = 0; c < 10; c++) {
         if (stack[c].identifier == NULL)
             break;
@@ -346,7 +346,7 @@ struct ConfigResult *parse_config(const char *input, struct context *context) {
 
     /* The "<=" operator is intentional: We also handle the terminating 0-byte
      * explicitly by looking for an 'end' token. */
-    while ((walk - input) <= len) {
+    while ((size_t)(walk - input) <= len) {
         /* Skip whitespace before every token, newlines are relevant since they
          * separate configuration directives. */
         while ((*walk == ' ' || *walk == '\t') && *walk != '\0')
@@ -446,6 +446,16 @@ struct ConfigResult *parse_config(const char *input, struct context *context) {
                 }
             }
 
+            if (strcmp(token->name, "line") == 0) {
+               while (*walk != '\0' && *walk != '\n' && *walk != '\r')
+                  walk++;
+               next_state(token);
+               token_handled = true;
+               linecnt++;
+               walk++;
+               break;
+            }
+
             if (strcmp(token->name, "end") == 0) {
                 //printf("checking for end: *%s*\n", walk);
                 if (*walk == '\0' || *walk == '\n' || *walk == '\r') {
@@ -575,7 +585,7 @@ struct ConfigResult *parse_config(const char *input, struct context *context) {
             y(map_close);
 
             /* Skip the rest of this line, but continue parsing. */
-            while ((walk - input) <= len && *walk != '\n')
+            while ((size_t)(walk - input) <= len && *walk != '\n')
                 walk++;
 
             free(position);
@@ -1059,6 +1069,8 @@ void parse_file(const char *f) {
         sasprintf(&pageraction, "i3-sensible-pager \"%s\"\n", errorfilename);
         char *argv[] = {
             NULL, /* will be replaced by the executable path */
+            "-f",
+            (config.font.pattern ? config.font.pattern : "fixed"),
             "-t",
             (context->has_errors ? "error" : "warning"),
             "-m",