From a3d03fc0fb18763633c97b85f531b299199cd1d7 Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Thu, 10 Jul 2025 18:49:23 +0200 Subject: [PATCH] Avoid duplicate flag values Both `SKIP_CMDSUBST` and `NO_SPACE_FOR_UNCLOSED_BRACE` used `1 << 14` as their value accidentally, resulting from `SKIP_CMDSUBST` not being sorted correctly. Resolve this by using the next (and last in u16) unused bit for `SKIP_CMDSUBST` and moving it to the end. Fixes #11651. --- src/expand.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/expand.rs b/src/expand.rs index b4a98146a..23a95e7c2 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -38,8 +38,6 @@ pub struct ExpandFlags : u16 { /// Fail expansion if there is a command substitution. const FAIL_ON_CMDSUBST = 1 << 0; - /// Skip command substitutions. - const SKIP_CMDSUBST = 1 << 14; /// Skip variable expansion. const SKIP_VARIABLES = 1 << 1; /// Skip wildcard expansion. @@ -75,6 +73,8 @@ pub struct ExpandFlags : u16 { const SPECIAL_FOR_COMMAND = 1 << 13; /// The token has an unclosed brace, so don't add a space. const NO_SPACE_FOR_UNCLOSED_BRACE = 1 << 14; + /// Skip command substitutions. + const SKIP_CMDSUBST = 1 << 15; } }