summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de6f0de)
raw | patch | inline | side by side (parent: de6f0de)
author | Tommi Kyntola <tommi.kyntola@ray.fi> | |
Fri, 16 Feb 2007 08:50:58 +0000 (10:50 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 17 Feb 2007 05:39:21 +0000 (21:39 -0800) |
The 3rd branch in builtin-blame.c should also check for lacking
arguments. Running that in top dir does not trigger the problem
because the 'prefix' is NULL.
Signed-off-by: Tommi Kyntola <tommi.kyntola@ray.fi>
Signed-off-by: Junio C Hamano <junkio@cox.net>
arguments. Running that in top dir does not trigger the problem
because the 'prefix' is NULL.
Signed-off-by: Tommi Kyntola <tommi.kyntola@ray.fi>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-blame.c | patch | blob | history |
diff --git a/builtin-blame.c b/builtin-blame.c
index 69fc145a38090488e8da4b60a56154fc999b6fe5..1a752b95bb32578cd3ecb69153b55f605b8bfdc3 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
if (!strcmp(argv[j], "--"))
seen_dashdash = j;
if (seen_dashdash) {
+ /* (2) */
if (seen_dashdash + 1 != argc - 1)
usage(blame_usage);
path = add_prefix(prefix, argv[seen_dashdash + 1]);
}
else {
/* (3) */
+ if (argc <= i)
+ usage(blame_usage);
path = add_prefix(prefix, argv[i]);
if (i + 1 == argc - 1) {
final_commit_name = argv[i + 1];