about summary refs log tree commit diff
path: root/src/libglob/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libglob/lib.rs')
-rw-r--r--src/libglob/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libglob/lib.rs b/src/libglob/lib.rs
index d19924da5be..e7661b26b76 100644
--- a/src/libglob/lib.rs
+++ b/src/libglob/lib.rs
@@ -35,6 +35,7 @@ use std::cell::Cell;
 use std::{cmp, os, path};
 use std::io::fs;
 use std::path::is_sep;
+use std::strbuf::StrBuf;
 
 /**
  * An iterator that yields Paths from the filesystem that match a particular
@@ -308,7 +309,7 @@ impl Pattern {
      * match the input string and nothing else.
      */
     pub fn escape(s: &str) -> ~str {
-        let mut escaped = ~"";
+        let mut escaped = StrBuf::new();
         for c in s.chars() {
             match c {
                 // note that ! does not need escaping because it is only special inside brackets
@@ -322,7 +323,7 @@ impl Pattern {
                 }
             }
         }
-        escaped
+        escaped.into_owned()
     }
 
     /**