Make msgfile optional like other OS's

This commit is contained in:
christos 2011-12-29 16:41:38 +00:00
parent 8e707c4932
commit 6e1ec48784
2 changed files with 9 additions and 10 deletions

View File

@ -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>
.\"
.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

View File

@ -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);