summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-18 03:31:40 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-18 03:31:40 (GMT)
commit64982f75109dfc42967773f35301f2dcd30a1a9f (patch)
tree12c432b101d918e193bd01c259c56046907b0ba9
parent75118b13bc8187c629886b108929f996c47daf01 (diff)
downloadgit-64982f75109dfc42967773f35301f2dcd30a1a9f.zip
git-64982f75109dfc42967773f35301f2dcd30a1a9f.tar.gz
git-64982f75109dfc42967773f35301f2dcd30a1a9f.tar.bz2
[PATCH] (resend) show-diff.c off-by-one fix
The patch to introduce shell safety to show-diff has an off-by-one error. Here is an fix. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--show-diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/show-diff.c b/show-diff.c
index 8a66e59..36afb3c 100644
--- a/show-diff.c
+++ b/show-diff.c
@@ -27,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;