Introduce get_existing_workspace_by_name

This commit is contained in:
Orestis Floros
2018-03-27 22:18:17 +03:00
parent 45be56be33
commit 6a2728ba79
5 changed files with 32 additions and 38 deletions

View File

@ -427,11 +427,7 @@ void init_ws_for_output(Output *output, Con *content) {
if (strcmp(assignment->output, output_primary_name(output)) != 0)
continue;
/* check if this workspace actually exists */
Con *workspace = NULL, *out;
TAILQ_FOREACH(out, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(out),
!strcasecmp(child->name, assignment->name));
Con *workspace = get_existing_workspace_by_name(assignment->name);
if (workspace == NULL)
continue;