X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=rev-tree.c;h=bfc8b125794d5c7104ed955eb3021c5958fc11b5;hb=5aad72f2bc1527e1fcdf460f0a36b0bcc4117b4a;hp=ebeceb070b72744b47873c0a562d3ec692269a96;hpb=3b7d368f34715003c834233d9f23456bcb62b44a;p=git.git diff --git a/rev-tree.c b/rev-tree.c index ebeceb07..bfc8b125 100644 --- a/rev-tree.c +++ b/rev-tree.c @@ -1,8 +1,3 @@ -#define _XOPEN_SOURCE /* glibc2 needs this */ -#define _BSD_SOURCE /* for tm.tm_gmtoff */ -#include -#include - #include "cache.h" #include "commit.h" @@ -89,8 +84,7 @@ int main(int argc, char **argv) char *arg = argv[i]; if (!strcmp(arg, "--cache")) { - read_cache_file(argv[2]); - i++; + read_cache_file(argv[++i]); continue; } @@ -103,7 +97,7 @@ int main(int argc, char **argv) arg++; basemask |= 1<= MAX_COMMITS || get_sha1_hex(arg, sha1[nr])) + if (nr >= MAX_COMMITS || get_sha1(arg, sha1[nr])) usage("rev-tree [--edges] [--cache ] []"); process_commit(sha1[nr]); nr++;