From 9e121cf63398e419071badd11710fe68b52f6a7f Mon Sep 17 00:00:00 2001 From: yuni Date: Wed, 12 Jun 2024 00:59:07 +0200 Subject: [PATCH] fix off-by-one error in GameVars::normalize_varname() --- src/var.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/var.rs b/src/var.rs index 491b5a2..84ec5f0 100644 --- a/src/var.rs +++ b/src/var.rs @@ -564,7 +564,7 @@ impl GameVars { } else if parts.len() > 1 { // we got a key with at least one "$" // extract anything before the last "$": - let scope_part: String = parts[0..parts.len() - 2].join(SCOPE_SEPARATOR); + let scope_part: String = parts[0..parts.len() - 1].join(SCOPE_SEPARATOR); if scope_part.is_empty() { // we got a key like "$foo", just prefix the fallback scope