summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-10-18 07:16:45 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-18 07:16:45 (GMT)
commit694a764fc2af9463c2462ab1fc92b442fce1a54c (patch)
tree51baefcfe6bfd4fd77e8b6bdbb9baa412d6c7a47
parentea51d416c02bb26e9d7600f87b27deb42752e6b5 (diff)
downloadgit-694a764fc2af9463c2462ab1fc92b442fce1a54c.zip
git-694a764fc2af9463c2462ab1fc92b442fce1a54c.tar.gz
git-694a764fc2af9463c2462ab1fc92b442fce1a54c.tar.bz2
Handle "-" at beginning of filenames, part 3
This fixes the default built-in exec() of "diff" to add a "--" before the filenames, so that if a filename starts with a "-", the diff program won't think it's an option. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 823c8d0..306bcd9 100644
--- a/diff.c
+++ b/diff.c
@@ -174,7 +174,7 @@ static void builtin_diff(const char *name_a,
{
int i, next_at, cmd_size;
const char *const diff_cmd = "diff -L%s -L%s";
- const char *const diff_arg = "%s %s||:"; /* "||:" is to return 0 */
+ const char *const diff_arg = "-- %s %s||:"; /* "||:" is to return 0 */
const char *input_name_sq[2];
const char *label_path[2];
char *cmd;