Skip to content

Commit

Permalink
fix(povray,sbopkg): check filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Oct 3, 2023
1 parent afbfc75 commit 434eb08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion completions/povray
Expand Up @@ -46,7 +46,7 @@ _comp_cmd_povray()
*.ini\[ | *.ini\[*[^]]) # sections in .ini files
cur="${povcur#*\[}"
pfx="${povcur%\["$cur"}" # prefix == filename
[[ -r $pfx ]] || return
[[ -f $pfx && -r $pfx ]] || return
COMPREPLY=($(command sed -ne \
's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/p' -- "$pfx"))
# to prevent [bar] expand to nothing. can be done more easily?
Expand Down
4 changes: 2 additions & 2 deletions completions/sbopkg
Expand Up @@ -44,7 +44,7 @@ _comp_cmd_sbopkg()
fi
done

[[ -r $config ]] || return
[[ -f $config && -r $config ]] || return
. "$config"

for ((i = 1; i < ${#words[@]} - 1; i++)); do
Expand All @@ -59,7 +59,7 @@ _comp_cmd_sbopkg()
esac
done
local file=${REPO_ROOT-}/${REPO_NAME-}/${REPO_BRANCH-}/SLACKBUILDS.TXT
[[ -r $file ]] || return
[[ -f $file && -r $file ]] || return

COMPREPLY=($(
command sed -ne "/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p;}" \
Expand Down

0 comments on commit 434eb08

Please sign in to comment.