Skip to content

Commit

Permalink
reset IFS while invoking EDITOR to avoid weird quoting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cxreg committed Jul 6, 2012
1 parent 3f66d00 commit 98c9bf8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core/smartcd_edit
Expand Up @@ -65,7 +65,11 @@ EOF
########################################################################
EOF
fi
# Bash has trouble with eg EDITOR="emacs -nw" if you have changed IFS, so
# temporarily switch it back
IFS="$_old_ifs"
${EDITOR:-vi} "$tmpfile"
IFS=$'\n'
if [[ $? == 0 ]]; then
echo -n > "$smartcd_dir/$file"
if [[ -s "$tmpfile" ]]; then
Expand Down

0 comments on commit 98c9bf8

Please sign in to comment.