Subject: Re: [PATCH 3/3] git --help COMMAND brings up the git-COMMAND man-page., take two

From: "H. Peter Anvin" <[email-masked]>
Date: Tue, 15 Nov 2005 19:45:12 -0800

Andreas Ericsson wrote:
>  
> +static void show_man_page(char *git_cmd)
> +{
> +	char *page;
> +
> +	if (!strncmp(git_cmd, "git", 3))
> +		page = git_cmd;
> +	else {
> +		int page_len = strlen(git_cmd) + 4;
> +
> +		page = malloc(page_len + 1);
> +		strcpy(page, "git-");
> +		strcpy(page + 4, git_cmd);
> +		page[page_len] = 0;
> +	}
> +
> +	execlp("man", "man", page, NULL);
> +}
> +

The way this made it into the actual tree was to call /usr/bin/man, but 
still using execlp().  This is clearly bogus.  There *ARE* good reasons 
to use PATH resolutions for this, since man is one of the interactive 
commands the user may want to wrapper.

So please drop PATH_TO_MAN that made it into the repository and revert 
to the original patch.

	-hpa