pipefp = Popen (prog, "w");
expanded_prog = expand_path (prog, "notify", 0); if (!expanded_prog) { free (prog); return 1; }  pipefp = run_popen (expanded_prog, "w");
notify_proc (repository, filter)    char *repository;    char *filter;{    FILE *pipefp;    char *prog;    char *p;    char *q;    char *srepos;    struct notify_proc_args *args = notify_args;    srepos = Short_Repository (repository);    prog = xmalloc (strlen (filter) + strlen (args->notifyee) + 1);    /* Copy FILTER to PROG, replacing the first occurrence of %s with       the notifyee.  We only allocated enough memory for one %s, and I doubt       there is a need for more.  */    for (p = filter, q = prog; *p != '\0'; ++p)    {	if (p[0] == '%')	{	    if (p[1] == 's')	    {		strcpy (q, args->notifyee);		q += strlen (q);		strcpy (q, p + 2);		q += strlen (q);		break;	    }	    else		continue;	}	*q++ = *p;    }    *q = '\0';    pipefp = Popen (prog, "w");    if (pipefp == NULL)    {	error (0, errno, "cannot write entry to notify filter: %s", prog);	free (prog);	return 1;    }    fprintf (pipefp, "%s %s\n---\n", srepos, args->file);    fprintf (pipefp, "Triggered %s watch on %s\n", args->type, repository);    fprintf (pipefp, "By %s\n", args->who);    /* Lots more potentially useful information we could add here; see       logfile_write for inspiration.  */    free (prog);    return (pclose (pipefp));}