Skip to content

Commit 8e01eea

Browse files
committed
be more careful about concatenating '.' in parse_number_from_string (#2986)
1 parent 1cf5de8 commit 8e01eea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/machine/system_calls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,13 +911,13 @@ impl MachineState {
911911
use crate::parser::lexer::*;
912912

913913
let nx = self.store(self.deref(self.registers[2]));
914-
let add_dot = !string.ends_with('.');
914+
let add_dot = !string.ends_with('.') || string.ends_with("'.");
915915
let cursor = std::io::Cursor::new(string);
916916

917917
let iter = std::io::Read::chain(cursor, {
918918
let mut dot_buf: [u8; '.'.len_utf8()] = [0u8];
919919

920-
if add_dot {
920+
if add_dot && !string.ends_with('\'') {
921921
'.'.encode_utf8(&mut dot_buf);
922922
}
923923

0 commit comments

Comments
 (0)