Skip to content

Commit e73fcd0

Browse files
committed
---
yaml --- r: 63321 b: refs/heads/snap-stage3 c: da4e614 h: refs/heads/master i: 63319: d2cdfe9 v: v3
1 parent 610e4c8 commit e73fcd0

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f31767df66b9468cea81a3aceb34633fad213d67
4+
refs/heads/snap-stage3: da4e614742ea67677ed122985c1730590748d788
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libextra/term.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ impl Terminal {
105105
}
106106
pub fn reset(&self) {
107107
if self.color_supported {
108-
let s = expand(*self.ti.strings.find_equiv(&("op")).unwrap(), [], &mut Variables::new());
108+
let mut vars = Variables::new();
109+
let s = expand(*self.ti.strings.find_equiv(&("op")).unwrap(), [], &mut vars);
109110
if s.is_ok() {
110111
self.out.write(s.get());
111112
} else {

branches/snap-stage3/src/libextra/terminfo/parm.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,22 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
176176
} else { return Err(~"stack is empty") },
177177
'=' => if stack.len() > 1 {
178178
match (stack.pop(), stack.pop()) {
179-
(Number(y), Number(x)) => stack.push(Number(if x == y { 1 } else { 0 })),
179+
(Number(y), Number(x)) => stack.push(Number(if x == y { 1 }
180+
else { 0 })),
180181
_ => return Err(~"non-numbers on stack with =")
181182
}
182183
} else { return Err(~"stack is empty") },
183184
'>' => if stack.len() > 1 {
184185
match (stack.pop(), stack.pop()) {
185-
(Number(y), Number(x)) => stack.push(Number(if x > y { 1 } else { 0 })),
186+
(Number(y), Number(x)) => stack.push(Number(if x > y { 1 }
187+
else { 0 })),
186188
_ => return Err(~"non-numbers on stack with >")
187189
}
188190
} else { return Err(~"stack is empty") },
189191
'<' => if stack.len() > 1 {
190192
match (stack.pop(), stack.pop()) {
191-
(Number(y), Number(x)) => stack.push(Number(if x < y { 1 } else { 0 })),
193+
(Number(y), Number(x)) => stack.push(Number(if x < y { 1 }
194+
else { 0 })),
192195
_ => return Err(~"non-numbers on stack with <")
193196
}
194197
} else { return Err(~"stack is empty") },
@@ -353,12 +356,14 @@ mod test {
353356
#[test]
354357
fn test_basic_setabf() {
355358
let s = bytes!("\\E[48;5;%p1%dm");
356-
assert_eq!(expand(s, [Number(1)], &mut Variables::new()).unwrap(), bytes!("\\E[48;5;1m").to_owned());
359+
assert_eq!(expand(s, [Number(1)], &mut Variables::new()).unwrap(),
360+
bytes!("\\E[48;5;1m").to_owned());
357361
}
358362

359363
#[test]
360364
fn test_multiple_int_constants() {
361-
assert_eq!(expand(bytes!("%{1}%{2}%d%d"), [], &mut Variables::new()).unwrap(), bytes!("21").to_owned());
365+
assert_eq!(expand(bytes!("%{1}%{2}%d%d"), [], &mut Variables::new()).unwrap(),
366+
bytes!("21").to_owned());
362367
}
363368

364369
#[test]

0 commit comments

Comments
 (0)