{"thread":{"id":"32873","subject":"[PATCH] mergetools,difftool: fix printf usage","startedAt":"2013-02-10T01:21:25Z","lastAt":"2013-02-10T01:21:25Z","messageCount":1,"participants":["David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"209107","messageId":"1360459285-88709-1-git-send-email-davvid@gmail.com","threadId":"32873","inReplyTo":null,"subject":"[PATCH] mergetools,difftool: fix printf usage","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-10T01:21:25Z","receivedAt":"2013-02-10T01:21:25Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Prevent environment variables and filenames from masquerading\nas format strings for printf.\n\nReported-by: Asheesh Laroia <asheesh@asheesh.org>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n git-difftool--helper.sh | 2 +-\n mergetools/p4merge      | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-difftool--helper.sh b/git-difftool--helper.sh\nindex 3d0fe0c..b00ed95 100755\n--- a/git-difftool--helper.sh\n+++ b/git-difftool--helper.sh\n@@ -40,7 +40,7 @@ launch_merge_tool () {\n \t# the user with the real $MERGED name before launching $merge_tool.\n \tif should_prompt\n \tthen\n-\t\tprintf \"\\nViewing: '$MERGED'\\n\"\n+\t\tprintf \"\\nViewing: '%s'\\n\" \"$MERGED\"\n \t\tif use_ext_cmd\n \t\tthen\n \t\t\tprintf \"Launch '%s' [Y/n]: \" \\\ndiff --git a/mergetools/p4merge b/mergetools/p4merge\nindex 52f7c8f..8a36916 100644\n--- a/mergetools/p4merge\n+++ b/mergetools/p4merge\n@@ -30,5 +30,5 @@ create_empty_file () {\n \tempty_file=\"${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$\"\n \t>\"$empty_file\"\n \n-\tprintf \"$empty_file\"\n+\tprintf \"%s\" \"$empty_file\"\n }\n-- \n1.8.1.3.696.gfd94e3d.dirty\n"}]}