Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/gencat Make msgfile optional like other OS's



details:   https://anonhg.NetBSD.org/src/rev/4c528105240f
branches:  trunk
changeset: 772314:4c528105240f
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 29 16:41:38 2011 +0000

description:
Make msgfile optional like other OS's

diffstat:

 usr.bin/gencat/gencat.1 |   9 ++++-----
 usr.bin/gencat/gencat.c |  10 +++++-----
 2 files changed, 9 insertions(+), 10 deletions(-)

diffs (73 lines):

diff -r 890a45cf117e -r 4c528105240f usr.bin/gencat/gencat.1
--- a/usr.bin/gencat/gencat.1   Thu Dec 29 10:27:36 2011 +0000
+++ b/usr.bin/gencat/gencat.1   Thu Dec 29 16:41:38 2011 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: gencat.1,v 1.12 2009/03/09 19:24:32 joerg Exp $
+.\" $NetBSD: gencat.1,v 1.13 2011/12/29 16:41:38 christos Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" Written by Kee Hinckley <nazgul%somewhere.com@localhost>
 .\"
-.Dd November 4, 2008
+.Dd December 29, 2011
 .Dt GENCAT 1
 .Os
 .Sh NAME
@@ -38,14 +38,13 @@
 .Sh SYNOPSIS
 .Nm
 .Ar catfile
-.Ar msgfile
-.Op Ar msgfile ...
+.Op Ar msgfile|- ...
 .Sh DESCRIPTION
 The
 .Nm
 utility generates a formatted message catalog
 .Ar catfile
-from one or more message source text files
+from stdin or one or more message source text files
 .Ar msgfile .
 The file
 .Ar catfile
diff -r 890a45cf117e -r 4c528105240f usr.bin/gencat/gencat.c
--- a/usr.bin/gencat/gencat.c   Thu Dec 29 10:27:36 2011 +0000
+++ b/usr.bin/gencat/gencat.c   Thu Dec 29 16:41:38 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gencat.c,v 1.32 2011/09/21 14:33:35 christos Exp $     */
+/*     $NetBSD: gencat.c,v 1.33 2011/12/29 16:41:38 christos Exp $     */
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: gencat.c,v 1.32 2011/09/21 14:33:35 christos Exp $");
+__RCSID("$NetBSD: gencat.c,v 1.33 2011/12/29 16:41:38 christos Exp $");
 #endif
 
 /***********************************************************
@@ -163,7 +163,7 @@
        argc -= optind;
        argv += optind;
 
-       if (argc < 2) {
+       if (argc < 1) {
                usage();
                /* NOTREACHED */
        }
@@ -193,8 +193,8 @@
                }
        }
 
-       if (((*argv)[0] == '-') && ((*argv)[1] == '\0')) {
-               if (argc != 2)
+       if (argc < 2 || (((*argv)[0] == '-') && ((*argv)[1] == '\0'))) {
+               if (argc > 2)
                        usage();
                        /* NOTREACHED */
                MCParse(STDIN_FILENO);



Home | Main Index | Thread Index | Old Index