vers_ts->vn_rcs = xstrdup (vers_ts->vn_user); vers_ts->vn_tag = xstrdup (vers_ts->vn_user); } else { vers_ts->vn_rcs = RCS_getversion (rcsdata, vers_ts->tag, vers_ts->date, force_tag_match, 1); if (vers_ts->vn_rcs == NULL) vers_ts->vn_tag = NULL;
Version_TS (repository, options, tag, date, user, force_tag_match,	    set_time, entries, xfiles)    char *repository;    char *options;    char *tag;    char *date;    char *user;    int force_tag_match;    int set_time;    List *entries;    List *xfiles;{    Node *p;    RCSNode *rcsdata;    Vers_TS *vers_ts;    struct stickydirtag *sdtp;    /* get a new Vers_TS struct */    vers_ts = (Vers_TS *) xmalloc (sizeof (Vers_TS));    memset ((char *) vers_ts, 0, sizeof (*vers_ts));    /*     * look up the entries file entry and fill in the version and timestamp     * if entries is NULL, there is no entries file so don't bother trying to     * look it up (used by checkout -P)     */    if (entries == NULL)    {	sdtp = NULL;	p = NULL;    }    else    {	p = findnode (entries, user);	sdtp = (struct stickydirtag *) entries->list->data; /* list-private */    }    if (p != NULL)    {	Entnode *entdata = (Entnode *) p->data;	vers_ts->vn_user = xstrdup (entdata->version);	vers_ts->ts_rcs = xstrdup (entdata->timestamp);	vers_ts->ts_conflict = xstrdup (entdata->conflict);	if (!tag)	{	    if (!(sdtp && sdtp->aflag))		vers_ts->tag = xstrdup (entdata->tag);	}	if (!date)	{	    if (!(sdtp && sdtp->aflag))		vers_ts->date = xstrdup (entdata->date);	}	if (!options || (options && *options == '\0'))	{	    if (!(sdtp && sdtp->aflag))		vers_ts->options = xstrdup (entdata->options);	}	vers_ts->entdata = entdata;    }    /*     * -k options specified on the command line override (and overwrite)     * options stored in the entries file     */    if (options)	vers_ts->options = xstrdup (options);    else if (sdtp && sdtp->aflag == 0)    {	if (!vers_ts->options)	    vers_ts->options = xstrdup (sdtp->options);    }    if (!vers_ts->options)	vers_ts->options = xstrdup ("");    /*     * if tags were specified on the command line, they override what is in     * the Entries file     */    if (tag || date)    {	vers_ts->tag = xstrdup (tag);	vers_ts->date = xstrdup (date);    }    else if (!vers_ts->entdata && (sdtp && sdtp->aflag == 0))    {	if (!vers_ts->tag)	    vers_ts->tag = xstrdup (sdtp->tag);	if (!vers_ts->date)	    vers_ts->date = xstrdup (sdtp->date);    }    /* Now look up the info on the source controlled file */    if (xfiles != (List *) NULL)    {	p = findnode (xfiles, user);	if (p != NULL)	{	    rcsdata = (RCSNode *) p->data;	    rcsdata->refcount++;	}	else	    rcsdata = NULL;    }    else if (repository != NULL)	rcsdata = RCS_parse (user, repository);    else	rcsdata = NULL;    if (rcsdata != NULL)    {	/* squirrel away the rcsdata pointer for others */	vers_ts->srcfile = rcsdata;#ifndef DEATH_SUPPORT	/* (is this indeed death support?  I haven't looked carefully).  */	/* get RCS version number into vn_rcs (if appropriate) */	if (((vers_ts->tag || vers_ts->date) && force_tag_match) ||	    ((rcsdata->flags & VALID) && (rcsdata->flags & INATTIC) == 0))	{#endif	    if (vers_ts->tag && strcmp (vers_ts->tag, TAG_BASE) == 0)	    {		vers_ts->vn_rcs = xstrdup (vers_ts->vn_user);		vers_ts->vn_tag = xstrdup (vers_ts->vn_user);	    }	    else	    {		vers_ts->vn_rcs = RCS_getversion (rcsdata, vers_ts->tag,					    vers_ts->date, force_tag_match, 1);		if (vers_ts->vn_rcs == NULL)		    vers_ts->vn_tag = NULL;		else		{		    char *colon = strchr (vers_ts->vn_rcs, ':');		    if (colon)		    {			vers_ts->vn_tag = xstrdup (colon+1);			*colon = '\0';		    }		    else			vers_ts->vn_tag = xstrdup (vers_ts->vn_rcs);		}	    }#ifndef DEATH_SUPPORT	} #endif	/*	 * If the source control file exists and has the requested revision,	 * get the Date the revision was checked in.  If "user" exists, set	 * its mtime.	 */	if (set_time)	{	    struct utimbuf t;	    memset ((char *) &t, 0, sizeof (t));	    if (vers_ts->vn_rcs &&		(t.actime = t.modtime = RCS_getrevtime (rcsdata,		 vers_ts->vn_rcs, (char *) 0, 0)) != -1)		(void) utime (user, &t);	}    }    /* get user file time-stamp in ts_user */    if (entries != (List *) NULL)    {#ifdef SERVER_SUPPORT	if (server_active)	    time_stamp_server (user, vers_ts);	else#endif	    vers_ts->ts_user = time_stamp (user);    }    return (vers_ts);}