=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/commit.c,v retrieving revision 1.90 retrieving revision 1.91 diff -c -r1.90 -r1.91 *** src/usr.bin/cvs/commit.c 2007/01/11 18:06:49 1.90 --- src/usr.bin/cvs/commit.c 2007/01/12 17:25:33 1.91 *************** *** 1,4 **** ! /* $OpenBSD: commit.c,v 1.90 2007/01/11 18:06:49 jasper Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2006 Xavier Santolaria --- 1,4 ---- ! /* $OpenBSD: commit.c,v 1.91 2007/01/12 17:25:33 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2006 Xavier Santolaria *************** *** 26,32 **** void cvs_commit_local(struct cvs_file *); void cvs_commit_check_files(struct cvs_file *); ! static char *commit_diff_file(struct cvs_file *); static void commit_desc_set(struct cvs_file *); struct cvs_flisthead files_affected; --- 26,32 ---- void cvs_commit_local(struct cvs_file *); void cvs_commit_check_files(struct cvs_file *); ! static BUF *commit_diff_file(struct cvs_file *); static void commit_desc_set(struct cvs_file *); struct cvs_flisthead files_affected; *************** *** 200,210 **** void cvs_commit_local(struct cvs_file *cf) { ! BUF *b; int isnew; int l, openflags, rcsflags; ! char *f, rbuf[24], nbuf[24]; ! char *d = NULL; CVSENTRIES *entlist; char *attic, *repo, *rcsfile; --- 200,209 ---- void cvs_commit_local(struct cvs_file *cf) { ! BUF *b, *d; int isnew; int l, openflags, rcsflags; ! char rbuf[24], nbuf[24]; CVSENTRIES *entlist; char *attic, *repo, *rcsfile; *************** *** 293,301 **** fatal("cvs_commit_local: failed to load file"); } - cvs_buf_putc(b, '\0'); - f = cvs_buf_release(b); - if (isnew == 0) { if (rcs_deltatext_set(cf->file_rcs, cf->file_rcs->rf_head, d) == -1) --- 292,297 ---- *************** *** 305,318 **** if (rcs_rev_add(cf->file_rcs, RCS_HEAD_REV, logmsg, -1, NULL) == -1) fatal("cvs_commit_local: failed to add new revision"); ! if (rcs_deltatext_set(cf->file_rcs, cf->file_rcs->rf_head, f) == -1) fatal("cvs_commit_local: failed to set new HEAD delta"); - xfree(f); - - if (isnew == 0) - xfree(d); - if (cf->file_status == FILE_REMOVED) { if (rcs_state_set(cf->file_rcs, cf->file_rcs->rf_head, RCS_STATE_DEAD) == -1) --- 301,309 ---- if (rcs_rev_add(cf->file_rcs, RCS_HEAD_REV, logmsg, -1, NULL) == -1) fatal("cvs_commit_local: failed to add new revision"); ! if (rcs_deltatext_set(cf->file_rcs, cf->file_rcs->rf_head, b) == -1) fatal("cvs_commit_local: failed to set new HEAD delta"); if (cf->file_status == FILE_REMOVED) { if (rcs_state_set(cf->file_rcs, cf->file_rcs->rf_head, RCS_STATE_DEAD) == -1) *************** *** 391,400 **** } } ! static char * commit_diff_file(struct cvs_file *cf) { ! char*delta, *p1, *p2; BUF *b1, *b2, *b3; if (cf->file_status == FILE_MODIFIED || --- 382,391 ---- } } ! static BUF * commit_diff_file(struct cvs_file *cf) { ! char *p1, *p2; BUF *b1, *b2, *b3; if (cf->file_status == FILE_MODIFIED || *************** *** 428,436 **** if (cvs_diffreg(p1, p2, b3) == D_ERROR) fatal("commit_diff_file: failed to get RCS patch"); ! cvs_buf_putc(b3, '\0'); ! delta = cvs_buf_release(b3); ! return (delta); } static void --- 419,425 ---- if (cvs_diffreg(p1, p2, b3) == D_ERROR) fatal("commit_diff_file: failed to get RCS patch"); ! return (b3); } static void