archive: define MAX_ARGS where it's needed
MAX_EXTRA_ARGS is not used anymore, so remove it. MAX_ARGS is used only in builtin-upload-archive.c, so define it there. Also report the actual value we're comparing against when the number of args is too big. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rene Scharfe committed
Jul 25, 2008 at 12:41 UTC
7f4d0511af9d6c93656dda5a683632f5ae5b5278
2 files changed
+2
-4
archive.h
-3
@@ -1,9 +1,6 @@
1
#ifndef ARCHIVE_H
2
#define ARCHIVE_H
3
4
-#define MAX_EXTRA_ARGS 32
5
-#define MAX_ARGS (MAX_EXTRA_ARGS + 32)
6
-
4
struct archiver_args {
5
const char *base;
6
size_t baselen;
builtin-upload-archive.c
+2
-1
@@ -16,6 +16,7 @@ static const char deadchild[] =
16
static const char lostchild[] =
17
"git upload-archive: archiver process was lost";
18
19
+#define MAX_ARGS (64)
20
21
static int run_upload_archive(int argc, const char **argv, const char *prefix)
22
{
@@ -45,7 +46,7 @@ static int run_upload_archive(int argc, const char **argv, const char *prefix)
46
if (len == 0)
47
break; /* got a flush */
48
if (sent_argc > MAX_ARGS - 2)
48
- die("Too many options (>29)");
49
+ die("Too many options (>%d)", MAX_ARGS - 2);
50
51
if (p[len-1] == '\n') {
52
p[--len] = 0;