From 8e01eea440d72142ec2a03325a6ff371b479a440 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Tue, 1 Jul 2025 18:40:49 -0700 Subject: [PATCH] be more careful about concatenating '.' in parse_number_from_string (#2986) --- src/machine/system_calls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index dc5da32a..9d056ff9 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -911,13 +911,13 @@ impl MachineState { use crate::parser::lexer::*; let nx = self.store(self.deref(self.registers[2])); - let add_dot = !string.ends_with('.'); + let add_dot = !string.ends_with('.') || string.ends_with("'."); let cursor = std::io::Cursor::new(string); let iter = std::io::Read::chain(cursor, { let mut dot_buf: [u8; '.'.len_utf8()] = [0u8]; - if add_dot { + if add_dot && !string.ends_with('\'') { '.'.encode_utf8(&mut dot_buf); } -- 2.54.0