Validate the ws number for client assignment.
This commit is contained in:
parent
26c61850bd
commit
6cf7ac7655
|
@ -493,14 +493,19 @@ workspace_name:
|
||||||
assign:
|
assign:
|
||||||
TOKASSIGN WHITESPACE window_class WHITESPACE optional_arrow assign_target
|
TOKASSIGN WHITESPACE window_class WHITESPACE optional_arrow assign_target
|
||||||
{
|
{
|
||||||
printf("assignment of %s\n", $<string>3);
|
DLOG("assignment of %s\n", $<string>3);
|
||||||
|
|
||||||
struct Assignment *new = $<assignment>6;
|
struct Assignment *new = $<assignment>6;
|
||||||
printf(" to %d\n", new->workspace);
|
if (new->floating != ASSIGN_FLOATING_ONLY && new->workspace < 1) {
|
||||||
printf(" floating = %d\n", new->floating);
|
DLOG("Invalid client assignment, workspace number %d out of range\n", new->workspace);
|
||||||
|
free(new);
|
||||||
|
} else {
|
||||||
|
DLOG(" to %d\n", new->workspace);
|
||||||
|
DLOG(" floating = %d\n", new->floating);
|
||||||
new->windowclass_title = $<string>3;
|
new->windowclass_title = $<string>3;
|
||||||
TAILQ_INSERT_TAIL(&assignments, new, assignments);
|
TAILQ_INSERT_TAIL(&assignments, new, assignments);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
assign_target:
|
assign_target:
|
||||||
|
|
Loading…
Reference in New Issue