summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Perret <Olivier.Perret@mailbox.org>2021-04-30 11:51:58 +0200
committerOlivier Perret <Olivier.Perret@mailbox.org>2021-04-30 11:53:18 +0200
commit0bcbcef7dc5d5011a67bce7d6cc1aa1ce33a7c0c (patch)
treea8da43351bc8520de95283b6bfcd27fe6177c553
parent3b147bca0aee95a3cf1870921a48c841c4f130ac (diff)
c-family.kak: properly quote shell variable
This will fail with filenames with spaces otherwise
-rw-r--r--rc/filetype/c-family.kak4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/filetype/c-family.kak b/rc/filetype/c-family.kak
index 33fd31e5..57ee4a1c 100644
--- a/rc/filetype/c-family.kak
+++ b/rc/filetype/c-family.kak
@@ -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
@@ -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