]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: parser: limit of 10 workspaces is gone
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 27 Sep 2009 21:05:07 +0000 (23:05 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 27 Sep 2009 21:05:07 +0000 (23:05 +0200)
src/cfgparse.y

index 7c0bf900c44ae9d25b997614702bff7714854e3f..f41a69b0d1a11c1aee229b77485015213691437b 100644 (file)
@@ -313,22 +313,23 @@ workspace:
         TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen workspace_name
         {
                 int ws_num = $<number>3;
-                if (ws_num < 1 || ws_num > 10) {
+                if (ws_num < 1) {
                         LOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
                 } else {
-                        workspaces[ws_num - 1].preferred_screen = sstrdup($<string>7);
+                        Workspace *ws = workspace_get(ws_num - 1);
+                        ws->preferred_screen = sstrdup($<string>7);
                         if ($<string>8 != NULL)
-                                workspace_set_name(&(workspaces[ws_num - 1]), $<string>8);
+                                workspace_set_name(ws, $<string>8);
                 }
         }
         | TOKWORKSPACE WHITESPACE NUMBER workspace_name
         {
                 int ws_num = $<number>3;
-                if (ws_num < 1 || ws_num > 10) {
+                if (ws_num < 1) {
                         LOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
                 } else {
                         if ($<string>4 != NULL)
-                                        workspace_set_name(&(workspaces[ws_num - 1]), $<string>4);
+                                workspace_set_name(workspace_get(ws_num - 1), $<string>4);
                 }
         }
         ;