Module Name:    src
Committed By:   christos
Date:           Thu Dec 29 16:41:38 UTC 2011

Modified Files:
        src/usr.bin/gencat: gencat.1 gencat.c

Log Message:
Make msgfile optional like other OS's


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/gencat/gencat.1
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/gencat/gencat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/gencat/gencat.1
diff -u src/usr.bin/gencat/gencat.1:1.12 src/usr.bin/gencat/gencat.1:1.13
--- src/usr.bin/gencat/gencat.1:1.12	Mon Mar  9 15:24:32 2009
+++ src/usr.bin/gencat/gencat.1	Thu Dec 29 11:41:38 2011
@@ -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 <[email protected]>
 .\"
-.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

Index: src/usr.bin/gencat/gencat.c
diff -u src/usr.bin/gencat/gencat.c:1.32 src/usr.bin/gencat/gencat.c:1.33
--- src/usr.bin/gencat/gencat.c:1.32	Wed Sep 21 10:33:35 2011
+++ src/usr.bin/gencat/gencat.c	Thu Dec 29 11:41:38 2011
@@ -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 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (argc < 2) {
+	if (argc < 1) {
 		usage();
 		/* NOTREACHED */
 	}
@@ -193,8 +193,8 @@ main(int argc, char *argv[])
 		}
 	}
 
-	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);

Reply via email to