Re: [PATCH] Keep "git --git-dir" from causing a bus error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 22 Dec 2006, Brian Gernhardt wrote:

> diff --git a/git.c b/git.c
> index 73cf4d4..2b3c9f9 100644
> --- a/git.c
> +++ b/git.c
> @@ -59,11 +59,14 @@ static int handle_options(const char*** argv, int* argc)
>  		} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
>  			setup_pager();
>  		} else if (!strcmp(cmd, "--git-dir")) {
> -			if (*argc < 1)
> -				return -1;
> -			setenv("GIT_DIR", (*argv)[1], 1);
> -			(*argv)++;
> -			(*argc)--;
> +			if (*argc < 2) {
> +				fprintf(stderr, "No directory given for --git-dir.\n" );
> +				usage(git_usage_string);

Usage already exits, so you do not need this:

> +			} else {

Ciao,
Dscho
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]