Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

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

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:12

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help