summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-09-09 17:22:35 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-09-09 17:22:35 +0000
commitc1378442ef112af31c50ec7d6a467ed603355223 (patch)
tree8390b22bfae0a7d878c60197ad56db768e73b82e /usr.bin/rcs
parent364ef0c029e2fac634357ead9686630fb63d6019 (diff)
From Pierre Riteau:
Sync ident behavior with GNU RCS: - return 1 to the shell if any file could not be opened. - print an empty line after processing a file unless we couldn't open it (and not for the last one). OK niallo.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/ident.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/rcs/ident.c b/usr.bin/rcs/ident.c
index 1f237e89566..38a80ac12a5 100644
--- a/usr.bin/rcs/ident.c
+++ b/usr.bin/rcs/ident.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ident.c,v 1.24 2007/02/27 07:59:13 xsa Exp $ */
+/* $OpenBSD: ident.c,v 1.25 2007/09/09 17:22:34 ray Exp $ */
/*
* Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -45,9 +45,11 @@ static void ident_line(FILE *);
int
ident_main(int argc, char **argv)
{
- int i, ch;
+ int i, ch, status;
FILE *fp;
+ status = 0;
+
while ((ch = rcs_getopt(argc, argv, "qV")) != -1) {
switch(ch) {
case 'q':
@@ -71,15 +73,18 @@ ident_main(int argc, char **argv)
for (i = 0; i < argc; i++) {
if ((fp = fopen(argv[i], "r")) == NULL) {
warn("%s", argv[i]);
+ status = 1;
continue;
}
ident_file(argv[i], fp);
(void)fclose(fp);
+ if (i != argc - 1)
+ printf("\n");
}
}
- return (0);
+ return (status);
}