From 5cffc5bea1d9f847c6180704bc72b5d45887b0a3 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 6 Feb 2024 02:06:39 -0800 Subject: [PATCH] process: Fix operator precedence bug. Binary or has a higher precedence than ternary conditionals. Wrap the conditional expression in parentheses so it is evaluated first. --- src/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process.c b/src/process.c index c3dcdfc..7519cb0 100644 --- a/src/process.c +++ b/src/process.c @@ -1989,7 +1989,7 @@ static void DoCommandFlow(struct action *act) fore->w_flow = (fore->w_flow & FLOW_AUTO) ? FLOW_AUTOFLAG | FLOW_AUTO | FLOW_ON : FLOW_AUTOFLAG; } else if (ParseOnOff(act, &b) == 0) - fore->w_flow = (fore->w_flow & FLOW_AUTO) | b ? FLOW_ON : FLOW_OFF; + fore->w_flow = (fore->w_flow & FLOW_AUTO) | (b ? FLOW_ON : FLOW_OFF); } else { if (fore->w_flow & FLOW_AUTOFLAG) fore->w_flow = (fore->w_flow & FLOW_AUTO) | FLOW_ON; -- 2.39.2