Skip to content

Commit 4e4e2f7

Browse files
committed
auto merge of #7436 : kballard/rust/term-dumb, r=cmr
Unlike fg() and bg(), we haven't already checked for the presence of "op" in the terminfo when we call reset(), so we need to handle the case where it's missing. Also update the warn!() lines to avoid double-quoting the output. Fixes #7431.
2 parents 811e045 + d9fed2b commit 4e4e2f7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/libextra/term.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Terminal {
9797
if s.is_ok() {
9898
self.out.write(s.unwrap());
9999
} else {
100-
warn!(s.unwrap_err());
100+
warn!("%s", s.unwrap_err());
101101
}
102102
}
103103
}
@@ -113,17 +113,20 @@ impl Terminal {
113113
if s.is_ok() {
114114
self.out.write(s.unwrap());
115115
} else {
116-
warn!(s.unwrap_err());
116+
warn!("%s", s.unwrap_err());
117117
}
118118
}
119119
}
120120
pub fn reset(&self) {
121121
let mut vars = Variables::new();
122-
let s = expand(*self.ti.strings.find_equiv(&("op")).unwrap(), [], &mut vars);
122+
let s = do self.ti.strings.find_equiv(&("op"))
123+
.map_consume_default(Err(~"can't find op")) |&op| {
124+
expand(op, [], &mut vars)
125+
};
123126
if s.is_ok() {
124127
self.out.write(s.unwrap());
125128
} else {
126-
warn!(s.unwrap_err());
129+
warn!("%s", s.unwrap_err());
127130
}
128131
}
129132

0 commit comments

Comments
 (0)