Skip to content

Commit

Permalink
archive: define MAX_ARGS where it's needed
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Rene Scharfe authored and gitster committed Jul 26, 2008
1 parent c088543 commit 7f4d051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions archive.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef ARCHIVE_H
#define ARCHIVE_H

#define MAX_EXTRA_ARGS 32
#define MAX_ARGS (MAX_EXTRA_ARGS + 32)

struct archiver_args {
const char *base;
size_t baselen;
Expand Down
3 changes: 2 additions & 1 deletion builtin-upload-archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static const char deadchild[] =
static const char lostchild[] =
"git upload-archive: archiver process was lost";

#define MAX_ARGS (64)

static int run_upload_archive(int argc, const char **argv, const char *prefix)
{
Expand Down Expand Up @@ -45,7 +46,7 @@ static int run_upload_archive(int argc, const char **argv, const char *prefix)
if (len == 0)
break; /* got a flush */
if (sent_argc > MAX_ARGS - 2)
die("Too many options (>29)");
die("Too many options (>%d)", MAX_ARGS - 2);

if (p[len-1] == '\n') {
p[--len] = 0;
Expand Down

0 comments on commit 7f4d051

Please sign in to comment.