summaryrefslogtreecommitdiffstats
path: root/bash-completion/lsblk
diff options
context:
space:
mode:
authorSami Kerola2018-04-05 21:56:53 +0200
committerKarel Zak2018-04-06 13:03:38 +0200
commitc6f0bdfecc7b1bbadc644eb8f625473c34fe7cae (patch)
tree7dc67f9ac07525943544e9a3034ea362fb992386 /bash-completion/lsblk
parentfstrim: Return EXIT_FAILURE when FTRIM ioctl fails (diff)
downloadkernel-qcow2-util-linux-c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae.tar.gz
kernel-qcow2-util-linux-c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae.tar.xz
kernel-qcow2-util-linux-c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae.zip
bash-completion: fix few bash set -u issues
This is the same fix as in reference commit, and the same reason. Just correct few files missed earlier. Reference: abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'bash-completion/lsblk')
-rw-r--r--bash-completion/lsblk10
1 files changed, 5 insertions, 5 deletions
diff --git a/bash-completion/lsblk b/bash-completion/lsblk
index 4fef8fc84..bd86f9f79 100644
--- a/bash-completion/lsblk
+++ b/bash-completion/lsblk
@@ -20,15 +20,15 @@ _lsblk_module()
prefix="${cur%$realcur}"
for I in /sys/dev/block/*; do
J=${I##*/}
- MAJOR_ALL="$MAJOR_ALL ${J%%:*}"
+ MAJOR_ALL="${MAJOR_ALL:-""} ${J%%:*}"
done
- for WORD in $MAJOR_ALL; do
+ for WORD in ${MAJOR_ALL:-""}; do
if ! [[ $prefix == *"$WORD"* ]]; then
- MAJOR="$WORD $MAJOR"
+ MAJOR="$WORD ${MAJOR:-""}"
fi
done
compopt -o nospace
- COMPREPLY=( $(compgen -P "$prefix" -W "$MAJOR" -S ',' -- $realcur) )
+ COMPREPLY=( $(compgen -P "$prefix" -W "${MAJOR:-""}" -S ',' -- $realcur) )
return 0
;;
'-o'|'--output')
@@ -37,7 +37,7 @@ _lsblk_module()
prefix="${cur%$realcur}"
for WORD in $LSBLK_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSBLK_COLS="$WORD $LSBLK_COLS"
+ LSBLK_COLS="$WORD ${LSBLK_COLS:-""}"
fi
done
compopt -o nospace