X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=show-diff.c;h=36afb3cc91305c35d2d811be61b308c14fb1a63d;hb=839a7a06f35bf8cd563a41d6db97f453ab108129;hp=0af2f1051e4886277af3d55257d0dfd5bd2ca2e6;hpb=9fec8b26eff58e1f595e8619abf1e42c07645ff8;p=git.git diff --git a/show-diff.c b/show-diff.c index 0af2f105..36afb3cc 100644 --- a/show-diff.c +++ b/show-diff.c @@ -4,7 +4,6 @@ * Copyright (C) Linus Torvalds, 2005 */ #include "cache.h" -#include static char *diff_cmd = "diff -L '%s' -u -N - '%s'"; @@ -28,8 +27,8 @@ static char *sq_expand(char *src) int cnt, c; char *cp; - /* count single quote characters */ - for (cnt = 0, cp = src; *cp; cnt++, cp++) + /* count bytes needed to store the quoted string. */ + for (cnt = 1, cp = src; *cp; cnt++, cp++) if (*cp == '\'') cnt += 3;