On Fri, Oct 05, 2007 at 02:53:47PM +0200, Jan Wielemaker wrote: > +#define EXEC_PATH "/usr/local/bin" > + > +static int do_cvs_cmd(const char *me, char *arg) > +{ > + const char *my_argv[4]; > + const char *oldpath; > + > + if ( !arg ) > + die("no argument"); > + if ( strcmp(arg, "server") ) > + die("only allows git-cvsserver server: %s", arg); > + > + my_argv[0] = "cvsserver"; > + my_argv[1] = "server"; > + my_argv[2] = NULL; > + > + if ( (oldpath=getenv("PATH")) ) { > + char *newpath = malloc(strlen(oldpath)+strlen(EXEC_PATH)+5+1+1); > + > + sprintf(newpath, "PATH=%s:%s", EXEC_PATH, oldpath); > + putenv(newpath); > + } else { > + char *newpath = malloc(strlen(EXEC_PATH)+5+1); > + > + sprintf(newpath, "PATH=%s", EXEC_PATH); > + putenv(newpath); > + } > + > + return execv_git_cmd(my_argv); > +} This seems to be mostly a duplication of prepend_to_path from git.c Gruesse, -- Frank Lichtenheld <frank@xxxxxxxxxxxxxx> www: http://www.djpig.de/ - 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