Skip to content

Commit

Permalink
conditional: fix whitespace/comma parsing
Browse files Browse the repository at this point in the history
Older fvwm syntax allowed for:

    Next (!Something ThisThing OtherThing)

That is, without commas separating the conditionals.

When fvwm was refactored to improve logging (4a639a8), this behaviour
broke which meant no other conditionals were ever parsed correctly.

Fixes #513
  • Loading branch information
ThomasAdam committed Jul 8, 2021
1 parent 5095add commit db9d8b9
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions fvwm/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,17 +779,24 @@ void CreateConditionMask(char *flags, WindowConditionMask *mask)
}
}

if (allocated_condition != NULL)
if (tmp && *tmp)
{
free(allocated_condition);
allocated_condition = NULL;
}
if (next_condition && *next_condition)
{
next_condition = GetNextFullOption(
next_condition, &allocated_condition);
fvwm_debug( __func__,
"Use comma instead of whiespace to separate "
"conditions");
} else {
if (allocated_condition != NULL)
{
free(allocated_condition);
allocated_condition = NULL;
}
if (next_condition && *next_condition)
{
next_condition = GetNextFullOption(
next_condition, &allocated_condition);
}
tmp = allocated_condition;
}
tmp = allocated_condition;
condition = PeekToken(tmp, &tmp);
}

Expand Down

0 comments on commit db9d8b9

Please sign in to comment.