From 4876a5ad90c1e96ab42342a357e4763fa6fb5212 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" Date: Mon, 16 Feb 2026 02:50:26 +0900 Subject: [PATCH] fix buffer whitespace skip --- crates/vm/src/buffer.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/vm/src/buffer.rs b/crates/vm/src/buffer.rs index 6cbddb733..33670f1c3 100644 --- a/crates/vm/src/buffer.rs +++ b/crates/vm/src/buffer.rs @@ -228,6 +228,11 @@ impl FormatCode { let mut arg_count = 0usize; let mut codes = vec![]; while chars.peek().is_some() { + // Skip whitespace before repeat count or format char + while let Some(b' ' | b'\t' | b'\n' | b'\r') = chars.peek() { + chars.next(); + } + // determine repeat operator: let repeat = match chars.peek() { Some(b'0'..=b'9') => { @@ -246,11 +251,6 @@ impl FormatCode { _ => 1, }; - // Skip whitespace (Python ignores whitespace in format strings) - while let Some(b' ' | b'\t' | b'\n' | b'\r') = chars.peek() { - chars.next(); - } - // determine format char: let c = match chars.next() { Some(c) => c,