Skip to content

Commit

Permalink
c-family.kak: properly quote shell variable
Browse files Browse the repository at this point in the history
This will fail with filenames with spaces otherwise
  • Loading branch information
occivink committed Apr 30, 2021
1 parent 3b147bc commit 0bcbcef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rc/filetype/c-family.kak
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ define-command -hidden c-family-alternative-file %{
/*) altname="${alt_dir}/${file_noext}.${ext}" ;;
*) altname="${dir}/${alt_dir}/${file_noext}.${ext}" ;;
esac
if [ -f ${altname} ]; then
if [ -f "${altname}" ]; then
printf 'edit %%{%s}\n' "${altname}"
exit
fi
Expand All @@ -433,7 +433,7 @@ define-command -hidden c-family-alternative-file %{
/*) altname="${alt_dir}/${file_noext}.${ext}" ;;
*) altname="${dir}/${alt_dir}/${file_noext}.${ext}" ;;
esac
if [ -f ${altname} ]; then
if [ -f "${altname}" ]; then
printf 'edit %%{%s}\n' "${altname}"
exit
fi
Expand Down

0 comments on commit 0bcbcef

Please sign in to comment.