int readonlyfs = FALSE;
int logoff = FALSE;
mode_t cvsumask = UMASK_DFLT;
+char *RCS_citag = NULL;
char *CurDir;
*q = '\0';
if (!strncmp(buf, "tag=", 4)) {
- char *RCS_citag = strdup(buf+4);
- char *what = malloc(sizeof("RCSLOCALID")+1+strlen(RCS_citag)+1);
-
+ char *what;
+
+ RCS_citag = strdup(buf+4);
+ if (RCS_citag == NULL) {
+ printf("no memory for local tag\n");
+ return;
+ }
+ what = malloc(sizeof("RCSLOCALID")+1+strlen(RCS_citag)+1);
+ if (what == NULL) {
+ printf("no memory for local tag\n");
+ return;
+ }
sprintf(what, "RCSLOCALID=%s", RCS_citag);
putenv(what);
} else if (!strncmp(buf, "umask=", 6)) {
size_t len;
};
#define KEYWORD_INIT(s) (s), sizeof (s) - 1
-static const struct rcs_keyword keywords[] =
+static struct rcs_keyword keywords[] =
{
{ KEYWORD_INIT ("Author") },
{ KEYWORD_INIT ("Date") },
{ KEYWORD_INIT ("Revision") },
{ KEYWORD_INIT ("Source") },
{ KEYWORD_INIT ("State") },
+ { NULL, 0 },
{ NULL, 0 }
};
enum keyword
KEYWORD_RCSFILE,
KEYWORD_REVISION,
KEYWORD_SOURCE,
- KEYWORD_STATE
+ KEYWORD_STATE,
+ KEYWORD_LOCALID
};
/* Convert an RCS date string into a readable string. This is like
return;
}
+ if (RCS_citag != NULL && keywords[KEYWORD_LOCALID].string == NULL) {
+ keywords[KEYWORD_LOCALID].string = RCS_citag;
+ keywords[KEYWORD_LOCALID].len = strlen(RCS_citag);
+ }
+
/* If we are using -kkvl, dig out the locker information if any. */
locker = NULL;
if (expand == KFLAG_KVL && rcs->other != NULL)
case KEYWORD_HEADER:
case KEYWORD_ID:
+ case KEYWORD_LOCALID:
{
char *path;
int free_path;