Skip to content

Commit

Permalink
Support multiple package names in the package column
Browse files Browse the repository at this point in the history
  • Loading branch information
ilpianista committed Nov 8, 2016
1 parent d643e65 commit 6cebe84
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn main() {
match tds.first() {
Some(td) => {
let mut next = tds.next().next();
let pkgname = next.first().unwrap().text().trim().to_string();
let packages = next.first().unwrap().text();
next = next.next().next().next().next().next().next();
let info = ASA {
cve: td.text()
Expand All @@ -126,11 +126,13 @@ fn main() {
let status = next.first().unwrap().text().trim().to_string();

if !status.starts_with("Not Affected") {
match infos.entry(pkgname) {
Occupied(c) => c.into_mut(),
Vacant(c) => c.insert(vec![]),
}
.push(info);
for p in packages.split_whitespace() {
match infos.entry(p.to_string()) {
Occupied(c) => c.into_mut(),
Vacant(c) => c.insert(vec![]),
}
.push(info.clone());
}
}
}
None => {}
Expand Down

0 comments on commit 6cebe84

Please sign in to comment.