=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/rcsdiff.c,v retrieving revision 1.60 retrieving revision 1.61 diff -c -r1.60 -r1.61 *** src/usr.bin/rcs/rcsdiff.c 2006/05/04 07:06:58 1.60 --- src/usr.bin/rcs/rcsdiff.c 2006/05/05 15:47:36 1.61 *************** *** 1,4 **** ! /* $OpenBSD: rcsdiff.c,v 1.60 2006/05/04 07:06:58 xsa Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: rcsdiff.c,v 1.61 2006/05/05 15:47:36 xsa Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. *************** *** 45,51 **** rev1 = rev2 = NULL; rev_str1 = rev_str2 = NULL; ! status = 0; if (strlcpy(diffargs, "diff", sizeof(diffargs)) >= sizeof(diffargs)) errx(1, "diffargs too long"); --- 45,51 ---- rev1 = rev2 = NULL; rev_str1 = rev_str2 = NULL; ! status = D_SAME; if (strlcpy(diffargs, "diff", sizeof(diffargs)) >= sizeof(diffargs)) errx(1, "diffargs too long"); *************** *** 143,160 **** diff_file = argv[i]; /* No revisions given. */ ! if (rev_str1 == NULL) { ! if (rcsdiff_file(file, file->rf_head, argv[i]) < 0) ! status = 2; /* One revision given. */ ! } else if (rev_str2 == NULL) { ! if (rcsdiff_file(file, rev1, argv[i]) < 0) ! status = 2; /* Two revisions given. */ ! } else { ! if (rcsdiff_rev(file, rev1, rev2) < 0) ! status = 2; ! } rcs_close(file); --- 143,156 ---- diff_file = argv[i]; /* No revisions given. */ ! if (rev_str1 == NULL) ! status = rcsdiff_file(file, file->rf_head, argv[i]); /* One revision given. */ ! else if (rev_str2 == NULL) ! status = rcsdiff_file(file, rev1, argv[i]); /* Two revisions given. */ ! else ! status = rcsdiff_rev(file, rev1, rev2); rcs_close(file); *************** *** 194,200 **** memset(&tv, 0, sizeof(tv)); memset(&tv2, 0, sizeof(tv2)); ! ret = -1; b1 = b2 = NULL; diff_rev1 = rev; --- 190,196 ---- memset(&tv, 0, sizeof(tv)); memset(&tv2, 0, sizeof(tv2)); ! ret = D_ERROR; b1 = b2 = NULL; diff_rev1 = rev; *************** *** 253,260 **** if (utimes(path2, (const struct timeval *)&tv2) < 0) warn("utimes"); ! rcs_diffreg(path1, path2, NULL); ! ret = 0; out: if (fd != -1) --- 249,255 ---- if (utimes(path2, (const struct timeval *)&tv2) < 0) warn("utimes"); ! ret = rcs_diffreg(path1, path2, NULL); out: if (fd != -1) *************** *** 280,286 **** char rbuf1[64], rbuf2[64]; struct timeval tv[2], tv2[2]; ! ret = -1; b1 = b2 = NULL; memset(&tv, 0, sizeof(tv)); memset(&tv2, 0, sizeof(tv2)); --- 275,281 ---- char rbuf1[64], rbuf2[64]; struct timeval tv[2], tv2[2]; ! ret = D_ERROR; b1 = b2 = NULL; memset(&tv, 0, sizeof(tv)); memset(&tv2, 0, sizeof(tv2)); *************** *** 335,342 **** if (utimes(path2, (const struct timeval *)&tv2) < 0) warn("utimes"); ! rcs_diffreg(path1, path2, NULL); ! ret = 0; out: if (b1 != NULL) --- 330,336 ---- if (utimes(path2, (const struct timeval *)&tv2) < 0) warn("utimes"); ! ret = rcs_diffreg(path1, path2, NULL); out: if (b1 != NULL)