logentry.cmd = strdup(basename(cmd));
logentry.cmd = basename(cmd);
int logEvent(char *cmd, int eventtype,char *string) {    char *eventtable [] = {	_("%s babbles incoherently"),	_("%s succeeded"),	_("%s failed"),	_("%s cancelled at user request"),	_("%s failed due to a failed dependency"),	/* insert more here */	NULL    };    int x=0,len, rc;    struct logInfo logentry;        if (cmd) {	logentry.cmd = strdup(basename(cmd));	if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') &&	    ( logentry.cmd[1] >= '0' && logentry.cmd[1] <= '9' ) &&	    ( logentry.cmd[2] >= '0' && logentry.cmd[2] <= '9' ) )	  logentry.cmd+=3;    } else      logentry.cmd = strdup(_("(none)"));    if (!string) {      string = alloca(strlen(cmd)+1);      strcpy(string,cmd);    }        while (eventtable[x] && x<eventtype) x++;    if (!(eventtable[x])) x=0;        len=strlen(eventtable[x])+strlen(string);    logentry.line=malloc(len);    snprintf(logentry.line,len,eventtable[x],string);        logentry.pri = logpriority;    logentry.fac = logfacility;        rc = logLine(&logentry);    free(logentry.line);    free(logentry.cmd);    return rc;}