From 0bcbcef7dc5d5011a67bce7d6cc1aa1ce33a7c0c Mon Sep 17 00:00:00 2001 From: Olivier Perret Date: Fri, 30 Apr 2021 11:51:58 +0200 Subject: [PATCH] c-family.kak: properly quote shell variable This will fail with filenames with spaces otherwise --- rc/filetype/c-family.kak | 4 ++-- 1 file 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