diff options
author | 2007-09-09 17:22:34 +0000 | |
---|---|---|
committer | 2007-09-09 17:22:34 +0000 | |
commit | 74fdd43a4df8c71f88aaa45d69e910696f4ffacf (patch) | |
tree | 413137bb10b5a7bd8d4121cb8700036308e0c3e6 | |
parent | Mention -q in compatibility section. (diff) | |
download | wireguard-openbsd-74fdd43a4df8c71f88aaa45d69e910696f4ffacf.tar.xz wireguard-openbsd-74fdd43a4df8c71f88aaa45d69e910696f4ffacf.zip |
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.
-rw-r--r-- | usr.bin/rcs/ident.c | 11 |
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); } |