On 6/5/07, Junio C Hamano <gitster@xxxxxxxxx> wrote:
Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes: > This patch was inspired by ClearCase command 'ct man',... > diff --git a/help.c b/help.c > index 6a9af4d..78b1023 100644 > --- a/help.c > +++ b/help.c > @@ -9,6 +9,14 @@ > #include "common-cmds.h" > #include <sys/ioctl.h> > > +#ifndef HTML_DIR > +#define HTML_DIR "/usr/share/html/" > +#endif > + > +#ifndef HTML_PROGRAM > +#define HTML_PROGRAM "xdg-open" > +#endif > + > /* most GUI terminals set COLUMNS (although some don't export it) */ > static int term_columns(void) > { > @@ -183,6 +191,145 @@ static void show_man_page(const char *git_cmd) > execlp("man", "man", page, NULL); > } > > +static void show_html_page(const char *git_cmd) > +{ > + const char *html_dir; > + int len, ret, nr_quotes; > + char *p, *p2; > + const char *cp, *cp2; > + struct stat st; > + char *quoted_git_cmd; > + char *default_command = NULL; > + const char *command; >... > + /* append %p if there is not any %x */ > + if (!strchr(command, '%')) { > + len = strlen(command); > + default_command = xmalloc(len + 3 + 1); /* space %p */ > + strcpy(default_command, command); > + strcat(default_command, " %p"); > + command = default_command; > + } > + > + /* first pass, calculate command length */ > ... Hmmm. Makes one wonder why interpolate is not used....
Sorry for my ignorant. I have no idea where to use interpolate :( Did you mean to pretend adding %p to command without alloc new buffer (default_command) ? -- Duy - 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