From c1378442ef112af31c50ec7d6a467ed603355223 Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Sun, 9 Sep 2007 17:22:35 +0000 Subject: 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. --- usr.bin/rcs/ident.c | 11 ++++++++--- 1 file 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 * 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); } -- cgit v1.2.3