diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-10-28 09:52:57 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-10-28 09:52:57 +0000 |
commit | d5d323d6aa84ef262c7a02b6b1d16cb2319c86e8 (patch) | |
tree | b6be7bd92ac48b6fd5d2b12f8731a41444056aaf | |
parent | 28ead8060cb857320903feee71569f8eb69c6f52 (diff) |
add support for `-L'; niallo ok
-rw-r--r-- | usr.bin/rcs/rlog.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c index feff8214e59..394b3950988 100644 --- a/usr.bin/rcs/rlog.c +++ b/usr.bin/rcs/rlog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rlog.c,v 1.10 2005/10/26 19:07:30 xsa Exp $ */ +/* $OpenBSD: rlog.c,v 1.11 2005/10/28 09:52:56 xsa Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -45,6 +45,7 @@ static int rlog_file(const char *, const char *, RCSFILE *); "=============================================================================" static int hflag; +static int Lflag; static int tflag; static int Nflag; @@ -57,11 +58,14 @@ rlog_main(int argc, char **argv) RCSFILE *file; hflag = Rflag = 0; - while ((ch = rcs_getopt(argc, argv, "hNqRTtV")) != -1) { + while ((ch = rcs_getopt(argc, argv, "hLNqRTtV")) != -1) { switch (ch) { case 'h': hflag = 1; break; + case 'L': + Lflag = 1; + break; case 'N': Nflag = 1; break; @@ -105,13 +109,19 @@ rlog_main(int argc, char **argv) if (rcs_statfile(argv[i], fpath, sizeof(fpath)) < 0) continue; - if (Rflag == 1) { - printf("%s\n", fpath); + if ((file = rcs_open(fpath, RCS_READ)) == NULL) + continue; + + if ((Lflag == 1) && (TAILQ_EMPTY(&(file->rf_locks)))) { + rcs_close(file); continue; } - if ((file = rcs_open(fpath, RCS_READ)) == NULL) + if (Rflag == 1) { + printf("%s\n", fpath); + rcs_close(file); continue; + } rlog_file(argv[i], fpath, file); @@ -125,7 +135,7 @@ void rlog_usage(void) { fprintf(stderr, - "usage: rlog [-hNqRTtV] file ...\n"); + "usage: rlog [-hLNqRTtV] file ...\n"); } static int |