|
|
|
@ -214,19 +214,19 @@ pub enum ExpandError {
|
|
|
|
|
|
|
|
|
|
fn expand(text: &str) -> Result<String, ExpandError> {
|
|
|
|
|
let chars = text.chars();
|
|
|
|
|
let mut escape = false;
|
|
|
|
|
// let mut escape = false;
|
|
|
|
|
let mut s = String::new();
|
|
|
|
|
for c in chars {
|
|
|
|
|
if !escape && c == '\\' {
|
|
|
|
|
escape = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if escape {
|
|
|
|
|
s.push(c);
|
|
|
|
|
escape = false;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// if !escape && c == '\\' {
|
|
|
|
|
// escape = true;
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// if escape {
|
|
|
|
|
// s.push(c);
|
|
|
|
|
// escape = false;
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if c == '~' {
|
|
|
|
|
let p = home_dir()?;
|
|
|
|
|