mergetools,difftool: fix printf usage
PATCH 1/1 mergetools,difftool: fix printf usage
Prevent environment variables and filenames from masquerading as format strings for printf.
Reported-by Asheesh Laroia <[email protected]>
Signed-off-by David Aguilar <[email protected]>
--- git-difftool--helper.sh | 2 +- mergetools/p4merge | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
git-difftool--helper.sh +1 -1
@@ -40,7 +40,7 @@ launch_merge_tool () { # the user with the real $MERGED name before launching $merge_tool. if should_prompt then - printf "\nViewing: '$MERGED'\n" + printf "\nViewing: '%s'\n" "$MERGED" if use_ext_cmd then printf "Launch '%s' [Y/n]: " \
mergetools/p4merge +1 -1
@@ -30,5 +30,5 @@ create_empty_file () { empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$" >"$empty_file" - printf "$empty_file" + printf "%s" "$empty_file" }
Signature · 1 line
1.8.1.3.696.gfd94e3d.dirty