Skip to content

Commit 780e7c5

Browse files
committed
[2 of 2]: filter::parse_spec() ignore bogon empty, blank substrings
Fix issue demonstrated by unit tests in commit 2ff2bf1. While parsing comma-separated substrings, parse_spec() now trims the values to ensure empty and blank substrings (which are invalid) are ignored. Previously, only-comma-separated empty substrings were being ignored. This change extends that intent to also ignore the empty string (no comma), stand-alone blank strings (no comma), and comma- separated variations of empty and/or blank substrings.
1 parent 1205e4d commit 780e7c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/filter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ fn parse_spec(spec: &str) -> (Vec<Directive>, Option<inner::Filter>) {
299299
return (dirs, None);
300300
}
301301
if let Some(m) = mods {
302-
for s in m.split(',') {
302+
for s in m.split(',').map(|ss| ss.trim()) {
303303
if s.is_empty() {
304304
continue;
305305
}

0 commit comments

Comments
 (0)