diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-11 16:43:54 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-11 16:43:54 -0700 |
commit | fdcf5294b4a60c2a1a75e40442cb09b58e470885 (patch) | |
tree | 40d85239a3443428451b60aebcf1a10062413dfc | |
parent | 7f29fdf77ee0cf5e1eeb9b9829d377629d24aeea (diff) | |
download | vyatta-cfg-fdcf5294b4a60c2a1a75e40442cb09b58e470885.tar.gz vyatta-cfg-fdcf5294b4a60c2a1a75e40442cb09b58e470885.zip |
fix for bug 6032
* handle unescaped double quotes in val_help.
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 80e7777..5d48b6e 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -689,11 +689,12 @@ vyatta_parse_tmpl () local vhstr=$(grep '^val_help:' $1 | sed 's/^val_help:[ ]*//; s/[ ]*;[ ]*/;/' \ | while read line; do - if [[ "$line" == *";"* ]]; then - echo "vyatta_cfg_val_type+=( \"${line%%;*}\" )" - echo "vyatta_cfg_val_help+=( \"${line##*;}\" )" + local nl=${line//\'/\'\\\\\\\'\'} + if [[ "$nl" == *";"* ]]; then + echo "vyatta_cfg_val_type+=( '${nl%%;*}' )" + echo "vyatta_cfg_val_help+=( '${nl##*;}' )" else - echo "vyatta_cfg_val_help+=( \"$line\" )" + echo "vyatta_cfg_val_help+=( '$nl' )" fi done) eval "$vhstr" |