Skip to content

Commit

Permalink
auto merge of #7436 : kballard/rust/term-dumb, r=cmr
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jun 28, 2013
2 parents 811e045 + d9fed2b commit 4e4e2f7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/libextra/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Terminal {
if s.is_ok() {
self.out.write(s.unwrap());
} else {
warn!(s.unwrap_err());
warn!("%s", s.unwrap_err());
}
}
}
Expand All @@ -113,17 +113,20 @@ impl Terminal {
if s.is_ok() {
self.out.write(s.unwrap());
} else {
warn!(s.unwrap_err());
warn!("%s", s.unwrap_err());
}
}
}
pub fn reset(&self) {
let mut vars = Variables::new();
let s = expand(*self.ti.strings.find_equiv(&("op")).unwrap(), [], &mut vars);
let s = do self.ti.strings.find_equiv(&("op"))
.map_consume_default(Err(~"can't find op")) |&op| {
expand(op, [], &mut vars)
};
if s.is_ok() {
self.out.write(s.unwrap());
} else {
warn!(s.unwrap_err());
warn!("%s", s.unwrap_err());
}
}

Expand Down

0 comments on commit 4e4e2f7

Please sign in to comment.