version 1.13, 2004/09/27 15:33:44 |
version 1.14, 2004/12/06 21:03:12 |
|
|
break; |
break; |
if (dlp->rl_lineno > lineno) { |
if (dlp->rl_lineno > lineno) { |
dlp = TAILQ_PREV(dlp, rcs_tqh, rl_list); |
dlp = TAILQ_PREV(dlp, rcs_tqh, rl_list); |
} |
} else if (dlp->rl_lineno < lineno) { |
else if (dlp->rl_lineno < lineno) { |
|
ndlp = TAILQ_NEXT(dlp, rl_list); |
ndlp = TAILQ_NEXT(dlp, rl_list); |
if (ndlp->rl_lineno > lineno) |
if (ndlp->rl_lineno > lineno) |
break; |
break; |
|
|
TAILQ_REMOVE(&(dlines->rl_lines), dlp, rl_list); |
TAILQ_REMOVE(&(dlines->rl_lines), dlp, rl_list); |
dlp = ndlp; |
dlp = ndlp; |
} |
} |
} |
} else if (op == 'a') { |
else if (op == 'a') { |
|
for (i = 0; i < nbln; i++) { |
for (i = 0; i < nbln; i++) { |
ndlp = lp; |
ndlp = lp; |
lp = TAILQ_NEXT(lp, rl_list); |
lp = TAILQ_NEXT(lp, rl_list); |
|
|
|
|
lp = ndlp; |
lp = ndlp; |
} |
} |
} |
} else { |
else { |
|
cvs_log(LP_ERR, "unknown RCS patch operation `%c'", op); |
cvs_log(LP_ERR, "unknown RCS patch operation `%c'", op); |
return (-1); |
return (-1); |
} |
} |
|
|
if (res == 1) { |
if (res == 1) { |
cvs_log(LP_ERR, "sorry, can't travel in the future yet"); |
cvs_log(LP_ERR, "sorry, can't travel in the future yet"); |
return (NULL); |
return (NULL); |
} |
} else { |
else { |
|
rdp = rcs_findrev(rfp, rfp->rf_head); |
rdp = rcs_findrev(rfp, rfp->rf_head); |
if (rdp == NULL) { |
if (rdp == NULL) { |
cvs_log(LP_ERR, "failed to get RCS HEAD revision"); |
cvs_log(LP_ERR, "failed to get RCS HEAD revision"); |
|
|
if (tok == RCS_TOK_ERR) { |
if (tok == RCS_TOK_ERR) { |
cvs_log(LP_ERR, "parse error in RCS admin section"); |
cvs_log(LP_ERR, "parse error in RCS admin section"); |
return (-1); |
return (-1); |
} |
} else if (tok == RCS_TOK_NUM) { |
else if (tok == RCS_TOK_NUM) { |
|
/* assume this is the start of the first delta */ |
/* assume this is the start of the first delta */ |
rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok); |
rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok); |
return (0); |
return (0); |
|
|
if (tok == RCS_TOK_HEAD) { |
if (tok == RCS_TOK_HEAD) { |
rcsnum_aton(RCS_TOKSTR(rfp), NULL, |
rcsnum_aton(RCS_TOKSTR(rfp), NULL, |
rfp->rf_head); |
rfp->rf_head); |
} |
} else if (tok == RCS_TOK_BRANCH) { |
else if (tok == RCS_TOK_BRANCH) { |
|
rcsnum_aton(RCS_TOKSTR(rfp), NULL, |
rcsnum_aton(RCS_TOKSTR(rfp), NULL, |
rfp->rf_branch); |
rfp->rf_branch); |
} |
} else if (tok == RCS_TOK_COMMENT) { |
else if (tok == RCS_TOK_COMMENT) { |
|
rfp->rf_comment = strdup(RCS_TOKSTR(rfp)); |
rfp->rf_comment = strdup(RCS_TOKSTR(rfp)); |
if (rfp->rf_comment == NULL) { |
if (rfp->rf_comment == NULL) { |
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
"failed to duplicate rcs token"); |
"failed to duplicate rcs token"); |
return (-1); |
return (-1); |
} |
} |
} |
} else if (tok == RCS_TOK_EXPAND) { |
else if (tok == RCS_TOK_EXPAND) { |
|
rfp->rf_expand = strdup(RCS_TOKSTR(rfp)); |
rfp->rf_expand = strdup(RCS_TOKSTR(rfp)); |
if (rfp->rf_expand == NULL) { |
if (rfp->rf_expand == NULL) { |
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
|
|
cvs_log(LP_ERR, "parse error in RCS delta section"); |
cvs_log(LP_ERR, "parse error in RCS delta section"); |
rcs_freedelta(rdp); |
rcs_freedelta(rdp); |
return (-1); |
return (-1); |
} |
} else if (tok == RCS_TOK_NUM || tok == RCS_TOK_DESC) { |
else if (tok == RCS_TOK_NUM || tok == RCS_TOK_DESC) { |
|
rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok); |
rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok); |
ret = (tok == RCS_TOK_NUM ? 1 : 0); |
ret = (tok == RCS_TOK_NUM ? 1 : 0); |
break; |
break; |
|
|
rdp->rd_date.tm_min = datenum->rn_id[4]; |
rdp->rd_date.tm_min = datenum->rn_id[4]; |
rdp->rd_date.tm_sec = datenum->rn_id[5]; |
rdp->rd_date.tm_sec = datenum->rn_id[5]; |
rcsnum_free(datenum); |
rcsnum_free(datenum); |
} |
} else if (tok == RCS_TOK_AUTHOR) { |
else if (tok == RCS_TOK_AUTHOR) { |
|
rdp->rd_author = tokstr; |
rdp->rd_author = tokstr; |
tokstr = NULL; |
tokstr = NULL; |
} |
} else if (tok == RCS_TOK_STATE) { |
else if (tok == RCS_TOK_STATE) { |
|
rdp->rd_state = tokstr; |
rdp->rd_state = tokstr; |
tokstr = NULL; |
tokstr = NULL; |
} |
} else if (tok == RCS_TOK_NEXT) { |
else if (tok == RCS_TOK_NEXT) { |
|
rcsnum_aton(tokstr, NULL, rdp->rd_next); |
rcsnum_aton(tokstr, NULL, rdp->rd_next); |
} |
} |
break; |
break; |
|
|
type = rcs_gettok(rfp); |
type = rcs_gettok(rfp); |
if (type != RCS_TOK_STRICT) { |
if (type != RCS_TOK_STRICT) { |
rcs_pushtok(rfp, RCS_TOKSTR(rfp), type); |
rcs_pushtok(rfp, RCS_TOKSTR(rfp), type); |
} |
} else { |
else { |
|
rfp->rf_flags |= RCS_RF_SLOCK; |
rfp->rf_flags |= RCS_RF_SLOCK; |
|
|
type = rcs_gettok(rfp); |
type = rcs_gettok(rfp); |
|
|
|
|
if (ch == EOF) { |
if (ch == EOF) { |
type = RCS_TOK_EOF; |
type = RCS_TOK_EOF; |
} |
} else if (ch == ';') { |
else if (ch == ';') { |
|
type = RCS_TOK_SCOLON; |
type = RCS_TOK_SCOLON; |
} |
} else if (ch == ':') { |
else if (ch == ':') { |
|
type = RCS_TOK_COLON; |
type = RCS_TOK_COLON; |
} |
} else if (isalpha(ch)) { |
else if (isalpha(ch)) { |
|
*(bp++) = ch; |
*(bp++) = ch; |
while (bp <= bep - 1) { |
while (bp <= bep - 1) { |
ch = getc(pdp->rp_file); |
ch = getc(pdp->rp_file); |
|
|
if (type == RCS_TOK_ERR) |
if (type == RCS_TOK_ERR) |
type = RCS_TOK_STRING; |
type = RCS_TOK_STRING; |
|
|
} |
} else if (ch == '@') { |
else if (ch == '@') { |
|
/* we have a string */ |
/* we have a string */ |
for (;;) { |
for (;;) { |
ch = getc(pdp->rp_file); |
ch = getc(pdp->rp_file); |
|
|
ungetc(ch, pdp->rp_file); |
ungetc(ch, pdp->rp_file); |
break; |
break; |
} |
} |
} |
} else if (ch == '\n') |
else if (ch == '\n') |
|
pdp->rp_line++; |
pdp->rp_line++; |
|
|
*(bp++) = ch; |
*(bp++) = ch; |
|
|
|
|
*bp = '\0'; |
*bp = '\0'; |
type = RCS_TOK_STRING; |
type = RCS_TOK_STRING; |
} |
} else if (isdigit(ch)) { |
else if (isdigit(ch)) { |
|
*(bp++) = ch; |
*(bp++) = ch; |
last = ch; |
last = ch; |
type = RCS_TOK_NUM; |
type = RCS_TOK_NUM; |
|
|
if (bp > (bep - 2)) |
if (bp > (bep - 2)) |
break; |
break; |
*(bp++) = '@'; |
*(bp++) = '@'; |
} |
} else { |
else { |
|
sp++; |
sp++; |
if (*sp != '@') { |
if (*sp != '@') { |
cvs_log(LP_WARN, |
cvs_log(LP_WARN, |