From 826cd8677dcb5bb580ac9055c5822b530a5e3452 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 22 Oct 2024 23:34:09 +0200 Subject: [PATCH 1/2] Parser: avoid closing a sub-path twice if parsing an endpoint fails immediately after starting a sub-path --- crates/extra/src/parser.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/extra/src/parser.rs b/crates/extra/src/parser.rs index d36d1c9e..96d16628 100644 --- a/crates/extra/src/parser.rs +++ b/crates/extra/src/parser.rs @@ -307,6 +307,7 @@ impl PathParser { 'm' | 'M' => { if self.need_end { output.end(false); + self.need_end = false; } let to = self.parse_endpoint(is_relative, src)?; @@ -753,3 +754,14 @@ fn issue_895() { parse("M 1.6e-9 1.4e-4 z").unwrap(); parse("M0 1.6e-9L0 1.4e-4").unwrap(); } + +#[test] +fn issue_919() { + let mut builder = lyon_path::Path::builder(); + let mut parser = PathParser::new(); + let _ = parser.parse( + &ParserOptions::DEFAULT, + &mut Source::new("0 0M".chars()), + &mut builder, + ); +} From 58872c51372fa1cc599e27443f6b1c030477373c Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 22 Oct 2024 23:34:54 +0200 Subject: [PATCH 2/2] lyon_extra 1.0.3 --- Cargo.lock | 2 +- crates/extra/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad8f74b2..fb240902 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1208,7 +1208,7 @@ dependencies = [ [[package]] name = "lyon_extra" -version = "1.0.2" +version = "1.0.3" dependencies = [ "lyon_path", "thiserror", diff --git a/crates/extra/Cargo.toml b/crates/extra/Cargo.toml index 37501da4..04ef0815 100644 --- a/crates/extra/Cargo.toml +++ b/crates/extra/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lyon_extra" -version = "1.0.2" +version = "1.0.3" description = "Various optional utilities for the lyon crate." authors = ["Nicolas Silva "] repository = "https://github.com/nical/lyon"