about summary refs log tree commit diff
path: root/src/libterm
diff options
context:
space:
mode:
Diffstat (limited to 'src/libterm')
-rw-r--r--src/libterm/lib.rs11
-rw-r--r--src/libterm/terminfo/mod.rs6
-rw-r--r--src/libterm/terminfo/parm.rs6
-rw-r--r--src/libterm/terminfo/parser/compiled.rs8
-rw-r--r--src/libterm/terminfo/searcher.rs8
5 files changed, 16 insertions, 23 deletions
diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs
index dd42bede13a..c953f591d80 100644
--- a/src/libterm/lib.rs
+++ b/src/libterm/lib.rs
@@ -48,17 +48,10 @@
        html_playground_url = "http://play.rust-lang.org/")]
 
 #![allow(unknown_features)]
-#![feature(macro_rules, phase, slicing_syntax, globs)]
-
+#![feature(slicing_syntax)]
 #![deny(missing_docs)]
 
-#[cfg(stage0)]
-#[phase(plugin, link)]
-extern crate log;
-
-#[cfg(not(stage0))]
-#[macro_use]
-extern crate log;
+#[macro_use] extern crate log;
 
 pub use terminfo::TerminfoTerminal;
 #[cfg(windows)]
diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs
index 80d195d9218..f2dcdc6160a 100644
--- a/src/libterm/terminfo/mod.rs
+++ b/src/libterm/terminfo/mod.rs
@@ -180,7 +180,7 @@ impl<T: Writer+Send> TerminfoTerminal<T> {
             }
         };
 
-        let entry = open(term[]);
+        let entry = open(term.index(&FullRange));
         if entry.is_err() {
             if os::getenv("MSYSCON").map_or(false, |s| {
                     "mintty.exe" == s
@@ -190,14 +190,14 @@ impl<T: Writer+Send> TerminfoTerminal<T> {
                                                   ti: msys_terminfo(),
                                                   num_colors: 8} as Box<Terminal<T>+Send>);
             }
-            debug!("error finding terminfo entry: {}", entry.err().unwrap());
+            debug!("error finding terminfo entry: {:?}", entry.err().unwrap());
             return None;
         }
 
         let mut file = entry.unwrap();
         let ti = parse(&mut file, false);
         if ti.is_err() {
-            debug!("error parsing terminfo entry: {}", ti.unwrap_err());
+            debug!("error parsing terminfo entry: {:?}", ti.unwrap_err());
             return None;
         }
 
diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs
index 04238f1c965..b0bce8f3112 100644
--- a/src/libterm/terminfo/parm.rs
+++ b/src/libterm/terminfo/parm.rs
@@ -290,7 +290,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
                     ';' => (),
 
                     _ => {
-                        return Err(format!("unrecognized format option {}", cur))
+                        return Err(format!("unrecognized format option {:?}", cur))
                     }
                 }
             },
@@ -552,7 +552,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> {
                     s
                 }
                 _ => {
-                    return Err(format!("non-string on stack with %{}",
+                    return Err(format!("non-string on stack with %{:?}",
                                        op.to_char()))
                 }
             }
@@ -636,7 +636,7 @@ mod test {
                     "Binop {} succeeded incorrectly with 1 stack entry", cap);
             let res = get_res("%{1}%{2}", cap, &[], vars);
             assert!(res.is_ok(),
-                    "Binop {} failed with 2 stack entries: {}", cap, res.unwrap_err());
+                    "Binop {} failed with 2 stack entries: {:?}", cap, res.unwrap_err());
         }
     }
 
diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs
index 5f0111c7d7a..7a06849abd1 100644
--- a/src/libterm/terminfo/parser/compiled.rs
+++ b/src/libterm/terminfo/parser/compiled.rs
@@ -163,7 +163,7 @@ pub fn parse(file: &mut io::Reader, longnames: bool)
     macro_rules! try { ($e:expr) => (
         match $e {
             Ok(e) => e,
-            Err(e) => return Err(format!("{}", e))
+            Err(e) => return Err(format!("{:?}", e))
         }
     ) }
 
@@ -284,13 +284,13 @@ pub fn parse(file: &mut io::Reader, longnames: bool)
 
 
             // Find the offset of the NUL we want to go to
-            let nulpos = string_table[offset as uint .. string_table_bytes as uint]
+            let nulpos = string_table.index(&((offset as uint) .. (string_table_bytes as uint)))
                 .iter().position(|&b| b == 0);
             match nulpos {
                 Some(len) => {
                     string_map.insert(name.to_string(),
-                                      string_table[offset as uint ..
-                                          offset as uint + len].to_vec())
+                                      string_table.index(&((offset as uint) ..
+                                          (offset as uint + len))).to_vec())
                 },
                 None => {
                     return Err("invalid file: missing NUL in \
diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs
index 395fac52d8d..2651be1ebb8 100644
--- a/src/libterm/terminfo/searcher.rs
+++ b/src/libterm/terminfo/searcher.rs
@@ -61,13 +61,13 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
     for p in dirs_to_search.iter() {
         if p.exists() {
             let f = first_char.to_string();
-            let newp = p.join_many(&[f[], term]);
+            let newp = p.join_many(&[f.index(&FullRange), term]);
             if newp.exists() {
                 return Some(box newp);
             }
             // on some installations the dir is named after the hex of the char (e.g. OS X)
             let f = format!("{:x}", first_char as uint);
-            let newp = p.join_many(&[f[], term]);
+            let newp = p.join_many(&[f.index(&FullRange), term]);
             if newp.exists() {
                 return Some(box newp);
             }
@@ -82,11 +82,11 @@ pub fn open(term: &str) -> Result<File, String> {
         Some(x) => {
             match File::open(&*x) {
                 Ok(file) => Ok(file),
-                Err(e) => Err(format!("error opening file: {}", e)),
+                Err(e) => Err(format!("error opening file: {:?}", e)),
             }
         }
         None => {
-            Err(format!("could not find terminfo entry for {}", term))
+            Err(format!("could not find terminfo entry for {:?}", term))
         }
     }
 }