Skip to content

Commit c2c6c08

Browse files
committed
fix(_umount,feh,sbopkg): check diretory name for "_comp_compgen -C"
* fix(_umount): specify the correct path as a directory * fix(feh): check the directory name before attempting path completion * fix(sbopkg): check the QUEUEDIR value before generating *.sqf
1 parent e9e665e commit c2c6c08

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

completions/_umount.linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ _comp_cmd_umount__linux_fstab()
7272
realcur="$(readlink -f "$cur." 2>/dev/null)/" ||
7373
realcur=$(readlink -f "$cur" 2>/dev/null)
7474
if [[ $realcur ]]; then
75-
local dirrealcur="" dircur="" basecur
75+
local dirrealcur="" dircur=. basecur
7676
if [[ $cur == */* ]]; then
7777
dirrealcur="${realcur%/*}/"
7878
dircur="${cur%/*}/"

completions/feh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ _comp_cmd_feh()
3333
for ((i = ${#words[@]} - 2; i > 0; i--)); do
3434
if [[ ${words[i]} == -@(C|-fontpath) ]]; then
3535
font_path="${words[i + 1]}"
36-
_comp_compgen -aC "$font_path" -- \
37-
-f -X "!*.@([tT][tT][fF])" -S /
36+
if [[ -d $font_path ]]; then
37+
_comp_compgen -aC "$font_path" -- \
38+
-f -X "!*.@([tT][tT][fF])" -S /
39+
fi
3840
fi
3941
done
4042
compopt -o nospace

completions/sbopkg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ _comp_cmd_sbopkg()
6363

6464
_comp_compgen_split -l -- "$(command sed -ne "s/^SLACKBUILD NAME: //p" \
6565
"$file")"
66-
_comp_compgen -aC "$QUEUEDIR" -- -f -X "!*.sqf"
66+
if [[ -d ${QUEUEDIR-} ]]; then
67+
_comp_compgen -aC "$QUEUEDIR" -- -f -X "!*.sqf"
68+
fi
6769
} &&
6870
complete -F _comp_cmd_sbopkg sbopkg
6971

0 commit comments

Comments
 (0)