summaryrefslogtreecommitdiff
path: root/contrib/mount
diff options
context:
space:
mode:
authorCrestez Dan Leonard <cdleonard@gmail.com>2010-02-08 09:50:39 +0200
committerCrestez Dan Leonard <cdleonard@gmail.com>2010-02-09 15:28:28 +0200
commit2f61acd068a67e630dd28ce04157908398dd8798 (patch)
treed56c9d211a62e9ed69cecfbe624d44e4e46e43b4 /contrib/mount
parentc0b77a03f55f06fc9a00b766307335574cc79293 (diff)
downloadbash-completion-2f61acd068a67e630dd28ce04157908398dd8798.tar.gz
(mount) Make mount work properly with ' in fstab
Diffstat (limited to 'contrib/mount')
-rw-r--r--contrib/mount9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/mount b/contrib/mount
index 6c94e3f9..1896dded 100644
--- a/contrib/mount
+++ b/contrib/mount
@@ -19,13 +19,14 @@ _reply_compgen_array()
# argument.
local i wlist
for i in ${!COMPREPLY[*]}; do
- local q=`printf %q "${COMPREPLY[$i]}"`
- wlist+=$(quote "$q")$'\n'
+ local q=$(quote "$(printf %q "${COMPREPLY[$i]}")")
+ wlist+=$q$'\n'
done
# We also have to add another round of escaping to $cur.
local ecur="$cur"
ecur="${ecur//\\/\\\\}"
+ ecur="${ecur//\'/\'}"
# Actually generate completions.
local oldifs=$IFS
@@ -47,8 +48,8 @@ _linux_fstab()
if [[ $fs_spec = [#]* ]]; then continue; fi
local oldifs="$IFS"
IFS=$'\0'
- [[ $fs_spec = */* ]] && eval "COMPREPLY+=( $'$fs_spec' )";
- [[ $fs_file = */* ]] && eval "COMPREPLY+=( $'$fs_file' )";
+ [[ $fs_spec = */* ]] && eval "COMPREPLY+=( $'${fs_spec//\'/\047}' )";
+ [[ $fs_file = */* ]] && eval "COMPREPLY+=( $'${fs_file//\'/\047}' )";
IFS="$oldifs"
done