=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/rcsdiff.c,v retrieving revision 1.75 retrieving revision 1.76 diff -c -r1.75 -r1.76 *** src/usr.bin/rcs/rcsdiff.c 2007/07/03 00:56:23 1.75 --- src/usr.bin/rcs/rcsdiff.c 2010/07/23 21:46:05 1.76 *************** *** 1,4 **** ! /* $OpenBSD: rcsdiff.c,v 1.75 2007/07/03 00:56:23 ray Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: rcsdiff.c,v 1.76 2010/07/23 21:46:05 ray Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. *************** *** 316,322 **** tv[0].tv_sec = (long)rcs_rev_getdate(file, rev); tv[1].tv_sec = tv[0].tv_sec; ! if ((b2 = rcs_buf_load(filename, BUF_AUTOEXT)) == NULL) { warnx("failed to load file: `%s'", filename); goto out; } --- 316,322 ---- tv[0].tv_sec = (long)rcs_rev_getdate(file, rev); tv[1].tv_sec = tv[0].tv_sec; ! if ((b2 = buf_load(filename, BUF_AUTOEXT)) == NULL) { warnx("failed to load file: `%s'", filename); goto out; } *************** *** 332,349 **** tv2[1].tv_sec = t; (void)xasprintf(&path1, "%s/diff1.XXXXXXXXXX", rcs_tmpdir); ! rcs_buf_write_stmp(b1, path1); ! rcs_buf_free(b1); b1 = NULL; if (utimes(path1, (const struct timeval *)&tv) < 0) warn("utimes"); (void)xasprintf(&path2, "%s/diff2.XXXXXXXXXX", rcs_tmpdir); ! rcs_buf_write_stmp(b2, path2); ! rcs_buf_free(b2); b2 = NULL; if (utimes(path2, (const struct timeval *)&tv2) < 0) --- 332,349 ---- tv2[1].tv_sec = t; (void)xasprintf(&path1, "%s/diff1.XXXXXXXXXX", rcs_tmpdir); ! buf_write_stmp(b1, path1); ! buf_free(b1); b1 = NULL; if (utimes(path1, (const struct timeval *)&tv) < 0) warn("utimes"); (void)xasprintf(&path2, "%s/diff2.XXXXXXXXXX", rcs_tmpdir); ! buf_write_stmp(b2, path2); ! buf_free(b2); b2 = NULL; if (utimes(path2, (const struct timeval *)&tv2) < 0) *************** *** 355,363 **** if (fd != -1) (void)close(fd); if (b1 != NULL) ! rcs_buf_free(b1); if (b2 != NULL) ! rcs_buf_free(b2); if (path1 != NULL) xfree(path1); if (path2 != NULL) --- 355,363 ---- if (fd != -1) (void)close(fd); if (b1 != NULL) ! buf_free(b1); if (b2 != NULL) ! buf_free(b2); if (path1 != NULL) xfree(path1); if (path2 != NULL) *************** *** 413,430 **** fprintf(stderr, "%s -r%s -r%s\n", diffargs, rbuf1, rbuf2); (void)xasprintf(&path1, "%s/diff1.XXXXXXXXXX", rcs_tmpdir); ! rcs_buf_write_stmp(b1, path1); ! rcs_buf_free(b1); b1 = NULL; if (utimes(path1, (const struct timeval *)&tv) < 0) warn("utimes"); (void)xasprintf(&path2, "%s/diff2.XXXXXXXXXX", rcs_tmpdir); ! rcs_buf_write_stmp(b2, path2); ! rcs_buf_free(b2); b2 = NULL; if (utimes(path2, (const struct timeval *)&tv2) < 0) --- 413,430 ---- fprintf(stderr, "%s -r%s -r%s\n", diffargs, rbuf1, rbuf2); (void)xasprintf(&path1, "%s/diff1.XXXXXXXXXX", rcs_tmpdir); ! buf_write_stmp(b1, path1); ! buf_free(b1); b1 = NULL; if (utimes(path1, (const struct timeval *)&tv) < 0) warn("utimes"); (void)xasprintf(&path2, "%s/diff2.XXXXXXXXXX", rcs_tmpdir); ! buf_write_stmp(b2, path2); ! buf_free(b2); b2 = NULL; if (utimes(path2, (const struct timeval *)&tv2) < 0) *************** *** 434,442 **** out: if (b1 != NULL) ! rcs_buf_free(b1); if (b2 != NULL) ! rcs_buf_free(b2); if (path1 != NULL) xfree(path1); if (path2 != NULL) --- 434,442 ---- out: if (b1 != NULL) ! buf_free(b1); if (b2 != NULL) ! buf_free(b2); if (path1 != NULL) xfree(path1); if (path2 != NULL)