[arch-commits] Commit in arch-audit/trunk (fix-term-crash.patch)
Levente Polyak
anthraxx at archlinux.org
Sat Feb 13 18:34:09 UTC 2021
Date: Saturday, February 13, 2021 @ 18:34:09
Author: anthraxx
Revision: 859526
upgpkg: arch-audit 0.1.16-1
Deleted:
arch-audit/trunk/fix-term-crash.patch
----------------------+
fix-term-crash.patch | 52 -------------------------------------------------
1 file changed, 52 deletions(-)
Deleted: fix-term-crash.patch
===================================================================
--- fix-term-crash.patch 2021-02-13 18:33:48 UTC (rev 859525)
+++ fix-term-crash.patch 2021-02-13 18:34:09 UTC (rev 859526)
@@ -1,52 +0,0 @@
-From 5176a625fb5a6b4daf6be996d714c3cef001750f Mon Sep 17 00:00:00 2001
-From: Andrea Scarpino <andrea at scarpino.dev>
-Date: Sun, 5 Apr 2020 20:21:44 +0200
-Subject: [PATCH] Fix crash when TERM isn't set
-
-Fixes #43
----
- src/main.rs | 18 ++++++++++++++++--
- 1 file changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/src/main.rs b/src/main.rs
-index 19e2b70..b0fd3d1 100644
---- a/src/main.rs
-+++ b/src/main.rs
-@@ -7,10 +7,13 @@ use log::{debug, info};
- use serde_json::Value;
- use std::cmp::Ordering;
- use std::collections::btree_map::Entry::{Occupied, Vacant};
--use std::collections::BTreeMap;
-+use std::collections::{BTreeMap, HashMap};
- use std::default::Default;
-+use std::io;
- use std::process::exit;
- use std::str;
-+use term::terminfo::TermInfo;
-+use term::{StdoutTerminal, TerminfoTerminal};
-
- mod avg;
- mod enums;
-@@ -416,7 +419,18 @@ fn test_merge_avgs() {
-
- /// Print a list of `avg::AVG`
- fn print_avgs(options: &Options, avgs: &BTreeMap<String, avg::AVG>) {
-- let mut t = term::stdout().expect("term::stdout failed");
-+ let fake_term = TermInfo {
-+ names: vec![],
-+ bools: HashMap::new(),
-+ numbers: HashMap::new(),
-+ strings: HashMap::new(),
-+ };
-+
-+ let mut t = match term::stdout() {
-+ Some(x) => x,
-+ None => Box::new(TerminfoTerminal::new_with_terminfo(io::stdout(), fake_term)) as Box<StdoutTerminal>
-+ };
-+
- for (pkg, avg) in avgs {
- match avg.fixed {
- Some(ref v) if avg.status != enums::Status::Vulnerable => {
---
-2.26.2
-
More information about the arch-commits
mailing list