]> git.sur5r.net Git - i3/i3/blobdiff - src/cfgparse.y
Bugfix: Ignore for_window commands with empty (invalid) criteria (+test) (Thanks...
[i3/i3] / src / cfgparse.y
index c0bf92af556fee1b364373af01d7830321456e1f..10ca48ccf609a4d9efff608e21b6843860ada305 100644 (file)
@@ -188,6 +188,7 @@ static char *migrate_config(char *input, off_t size) {
         ret = read(readpipe[0], converted + read_bytes, conv_size - read_bytes);
         if (ret == -1) {
             warn("Cannot read from pipe");
+            FREE(converted);
             return NULL;
         }
         read_bytes += ret;
@@ -658,6 +659,10 @@ bindsym:
 for_window:
     TOK_FOR_WINDOW match command
     {
+        if (match_is_empty(&current_match)) {
+            ELOG("Match is empty, ignoring this for_window statement\n");
+            break;
+        }
         printf("\t should execute command %s for the criteria mentioned above\n", $3);
         Assignment *assignment = scalloc(sizeof(Assignment));
         assignment->type = A_COMMAND;