version 1.185, 2006/07/08 09:25:44 |
version 1.186, 2006/07/30 03:47:48 |
|
|
expbuf[0] = '\0'; |
expbuf[0] = '\0'; |
|
|
if (mode & RCS_KWEXP_NAME) { |
if (mode & RCS_KWEXP_NAME) { |
if (strlcat(expbuf, "$", sizeof(expbuf)) |
if (strlcat(expbuf, "$", sizeof(expbuf)) >= sizeof(expbuf) || |
>= sizeof(expbuf) || |
strlcat(expbuf, kwstr, sizeof(expbuf)) >= sizeof(expbuf)) |
strlcat(expbuf, kwstr, sizeof(expbuf)) |
|
>= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: truncated"); |
fatal("rcs_expand_keywords: truncated"); |
if ((mode & RCS_KWEXP_VAL) && |
if ((mode & RCS_KWEXP_VAL) && |
strlcat(expbuf, ": ", sizeof(expbuf)) |
strlcat(expbuf, ": ", sizeof(expbuf)) >= sizeof(expbuf)) |
>= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: truncated"); |
fatal("rcs_expand_keywords: truncated"); |
} |
} |
|
|
|
|
if (mode & RCS_KWEXP_VAL) { |
if (mode & RCS_KWEXP_VAL) { |
if (kwtype & RCS_KW_RCSFILE) { |
if (kwtype & RCS_KW_RCSFILE) { |
if (!(kwtype & RCS_KW_FULLPATH)) |
if (!(kwtype & RCS_KW_FULLPATH)) |
(void)strlcat(expbuf, |
(void)strlcat(expbuf, basename(rcsfile), sizeof(expbuf)); |
basename(rcsfile), |
|
sizeof(expbuf)); |
|
else |
else |
(void)strlcat(expbuf, |
(void)strlcat(expbuf, rcsfile, sizeof(expbuf)); |
rcsfile, sizeof(expbuf)); |
if (strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf)) |
if (strlcat(expbuf, " ", |
fatal("rcs_expand_keywords: truncated"); |
sizeof(expbuf)) >= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: " |
|
"truncated"); |
|
} |
} |
|
|
if (kwtype & RCS_KW_REVISION) { |
if (kwtype & RCS_KW_REVISION) { |
rcsnum_tostr(rdp->rd_num, buf, |
rcsnum_tostr(rdp->rd_num, buf, sizeof(buf)); |
sizeof(buf)); |
if (strlcat(buf, " ", sizeof(buf)) >= sizeof(buf) || |
if (strlcat(buf, " ", sizeof(buf)) |
strlcat(expbuf, buf, sizeof(expbuf)) >= sizeof(buf)) |
>= sizeof(buf) || |
fatal("rcs_expand_keywords: truncated"); |
strlcat(expbuf, buf, |
|
sizeof(expbuf)) >= sizeof(buf)) |
|
fatal("rcs_expand_keywords: " |
|
"truncated"); |
|
} |
} |
|
|
if (kwtype & RCS_KW_DATE) { |
if (kwtype & RCS_KW_DATE) { |
fmt = "%Y/%m/%d %H:%M:%S "; |
fmt = "%Y/%m/%d %H:%M:%S "; |
|
|
strftime(buf, sizeof(buf), fmt, |
strftime(buf, sizeof(buf), fmt, &rdp->rd_date); |
&rdp->rd_date); |
if (strlcat(expbuf, buf, sizeof(expbuf)) >= sizeof(expbuf)) |
if (strlcat(expbuf, buf, |
fatal("rcs_expand_keywords: string truncated"); |
sizeof(expbuf)) >= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: " |
|
"string truncated"); |
|
} |
} |
|
|
if (kwtype & RCS_KW_AUTHOR) { |
if (kwtype & RCS_KW_AUTHOR) { |
if (strlcat(expbuf, rdp->rd_author, |
if (strlcat(expbuf, rdp->rd_author, sizeof(expbuf)) >= sizeof(expbuf) || |
sizeof(expbuf)) >= sizeof(expbuf) || |
strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf)) |
strlcat(expbuf, " ", |
fatal("rcs_expand_keywords: string truncated"); |
sizeof(expbuf)) >= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: " |
|
"string truncated"); |
|
} |
} |
|
|
if (kwtype & RCS_KW_STATE) { |
if (kwtype & RCS_KW_STATE) { |
if (strlcat(expbuf, rdp->rd_state, |
if (strlcat(expbuf, rdp->rd_state, sizeof(expbuf)) >= sizeof(expbuf) || |
sizeof(expbuf)) >= sizeof(expbuf) || |
strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf)) |
strlcat(expbuf, " ", |
fatal("rcs_expand_keywords: string truncated"); |
sizeof(expbuf)) >= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: " |
|
"string truncated"); |
|
} |
} |
|
|
/* order does not matter anymore below */ |
/* order does not matter anymore below */ |
if (kwtype & RCS_KW_LOG) |
if (kwtype & RCS_KW_LOG) |
if (strlcat(expbuf, " ", |
if (strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf)) |
sizeof(expbuf)) >= sizeof(expbuf)) |
fatal("rcs_expand_keywords: string truncated"); |
fatal("rcs_expand_keywords: " |
|
"string truncated"); |
|
|
|
if (kwtype & RCS_KW_SOURCE) { |
if (kwtype & RCS_KW_SOURCE) { |
if (strlcat(expbuf, rcsfile, |
if (strlcat(expbuf, rcsfile, sizeof(expbuf)) >= sizeof(expbuf) || |
sizeof(expbuf)) >= sizeof(expbuf) || |
strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf)) |
strlcat(expbuf, " ", |
fatal("rcs_expand_keywords: string truncated"); |
sizeof(expbuf)) >= sizeof(expbuf)) |
|
fatal("rcs_expand_keywords: " |
|
"string truncated"); |
|
} |
} |
|
|
if (kwtype & RCS_KW_NAME) |
if (kwtype & RCS_KW_NAME) |
if (strlcat(expbuf, " ", |
if (strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf)) |
sizeof(expbuf)) >= sizeof(expbuf)) |
fatal("rcs_expand_keywords: string truncated"); |
fatal("rcs_expand_keywords: " |
|
"string truncated"); |
|
} |
} |
|
|
/* end the expansion */ |
/* end the expansion */ |