From a9d9d3baa2457d7659737db0922ef88252334f40 Mon Sep 17 00:00:00 2001 From: kdergachev Date: Wed, 8 Jul 2026 23:04:47 +0300 Subject: [PATCH] Made $file in eval safe. Should not do the same for editor since then all of the GIT_EDITOR will be treated as command (flags included). --- bin/git-ignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-ignore b/bin/git-ignore index bc67ac1..165bcf7 100755 --- a/bin/git-ignore +++ b/bin/git-ignore @@ -117,7 +117,7 @@ add_patterns() { edit_file() { local file="${2/#~/$HOME}" if [ -f "$file" ]; then - echo "Editing $1 gitignore: ($2)" && eval "$(git var GIT_EDITOR) $file" + echo "Editing $1 gitignore: ($2)" && eval "$(git var GIT_EDITOR) $(printf '%q' "$file")" echo "Done." else echo "There is no $1 .gitignore yet." >&2