diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-11-14 19:27:19 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-11-14 19:27:19 +0000 |
| commit | 85853ada1e3c8ecfdffa72fad4fcf34860661f35 (patch) | |
| tree | 06f2b4d352e6ae873bd3883a9cd9a184e2ec4b33 | |
| parent | 50ab68c9c51dc14989ad5ee3d11442c8e452ebff (diff) | |
| download | gentoo-utils-85853ada1e3c8ecfdffa72fad4fcf34860661f35.tar.gz | |
take at least 1 version suffix to prevent allowing versions such as 1.0_atom-cmp
| -rw-r--r-- | src/atom/parsers.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/atom/parsers.rs b/src/atom/parsers.rs index d3eaf7a..e72c922 100644 --- a/src/atom/parsers.rs +++ b/src/atom/parsers.rs @@ -87,7 +87,7 @@ impl<'a> Parseable<'a, &'a str> for VersionSuffixes { fn parser() -> Self::Parser { VersionSuffix::parser() .separated_by(tag("_")) - .many() + .at_least(1) .map(|suffixes| VersionSuffixes(suffixes)) } } @@ -486,4 +486,11 @@ mod test { Cpv::parser().check_finished(it).unwrap(); } + + #[test] + fn test_cpv_without_version_but_trailing_almost_version() { + let it = InputIter::new("dev-perl/mod-p-2.3_"); + + assert!(Cpv::parser().parse_finished(it).is_err()); + } } |
