diff options
author | Matt Cable <wozz@wookie.net> | 2010-04-02 15:24:41 -0600 |
---|---|---|
committer | Matt Cable <wozz@wookie.net> | 2010-09-19 19:33:41 -0600 |
commit | 21e2a913bff765b8dc23f12309059f7446e0ff99 (patch) | |
tree | cac4c7ef1a919203c1b55df5f145d467808f2f27 | |
parent | 870551e960c6cb506fd7cc232a069432dfc72f2c (diff) | |
download | zsh-21e2a913bff765b8dc23f12309059f7446e0ff99.tar.gz zsh-21e2a913bff765b8dc23f12309059f7446e0ff99.tar.bz2 zsh-21e2a913bff765b8dc23f12309059f7446e0ff99.zip |
Escape &'s in path name. Need to find general function for escaping all
shell metacharacters.
-rw-r--r-- | lib/dirspersist.zsh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dirspersist.zsh b/lib/dirspersist.zsh index 8364a879c..973107c52 100644 --- a/lib/dirspersist.zsh +++ b/lib/dirspersist.zsh @@ -5,7 +5,8 @@ # Run dirpersiststore in ~/.zlogout dirpersiststore () { - dirs -p | sed 's/ /\\ /g;s/^/pushd -q /;1!G;h;$!d;' > ~/.zdirstore +# FIXME: need to escape all shell metacharacters, not just spaces! + dirs -p | sed 's/ /\\ /g;s/&/\\&/;s/^/pushd -q /;1!G;h;$!d;' > ~/.zdirstore } dirpersistrestore () { @@ -19,4 +20,4 @@ setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups dirpersistrestore # Make popd changes permanent without having to wait for logout -alias popd="popd;dirpersiststore"
\ No newline at end of file +alias popd="popd;dirpersiststore" |