diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-11-16 09:57:05 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-11-16 09:57:05 +0000 |
commit | 23b831739b0616b23e6bfa104c7eff061f8df72e (patch) | |
tree | 6881a66bd471bfcd18a96fa3d2c379234c8fbbec /usr.bin/rcs/rcsdiff.c | |
parent | 3087a7d72182a97bb04401ab22703d9d0c3fe5a3 (diff) |
- add file existence check
- do not pollute with uneeded error messages
Diffstat (limited to 'usr.bin/rcs/rcsdiff.c')
-rw-r--r-- | usr.bin/rcs/rcsdiff.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcsdiff.c b/usr.bin/rcs/rcsdiff.c index a6fb6cc6af4..cbd198e071d 100644 --- a/usr.bin/rcs/rcsdiff.c +++ b/usr.bin/rcs/rcsdiff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsdiff.c,v 1.14 2005/11/14 11:01:04 xsa Exp $ */ +/* $OpenBSD: rcsdiff.c,v 1.15 2005/11/16 09:57:04 xsa Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -118,14 +118,12 @@ rcsdiff_main(int argc, char **argv) if (rev2 == NULL) { if (rcsdiff_file(file, frev, argv[i]) < 0) { - cvs_log(LP_ERR, "failed to rcsdiff"); rcs_close(file); status = 2; continue; } } else { if (rcsdiff_rev(file, rev, rev2) < 0) { - cvs_log(LP_ERR, "failed to rcsdiff"); rcs_close(file); status = 2; continue; @@ -151,6 +149,12 @@ rcsdiff_file(RCSFILE *rfp, RCSNUM *rev, const char *filename) char path1[MAXPATHLEN], path2[MAXPATHLEN]; BUF *b1, *b2; char rbuf[64]; + struct stat st; + + if (stat(filename, &st) == -1) { + cvs_log(LP_ERRNO, "%s", filename); + return (-1); + } rcsnum_tostr(rev, rbuf, sizeof(rbuf)); if (verbose == 1) |