Recognize `-' only if it is the only argument after the time.
This commit is contained in:
parent
d311785b75
commit
fea6f55d8d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: shutdown.c,v 1.20 1998/01/20 23:05:15 mycroft Exp $ */
|
||||
/* $NetBSD: shutdown.c,v 1.21 1998/01/20 23:13:31 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1990, 1993
|
||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1990, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: shutdown.c,v 1.20 1998/01/20 23:05:15 mycroft Exp $");
|
||||
__RCSID("$NetBSD: shutdown.c,v 1.21 1998/01/20 23:13:31 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -162,8 +162,8 @@ main(argc, argv)
|
||||
|
||||
getoffset(*argv++);
|
||||
|
||||
if (*argv)
|
||||
if (strcmp(*argv, "-")) {
|
||||
if (argv[0])
|
||||
if (strcmp(argv[0], "-") || argv[1]) {
|
||||
for (p = mbuf, len = sizeof(mbuf); *argv; ++argv) {
|
||||
arglen = strlen(*argv);
|
||||
if ((len -= arglen) <= 2)
|
||||
@ -518,8 +518,8 @@ void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: shutdown [-dfhknr] [[[[[cc]yy]mm]dd]hh]mm [message | -]\n");
|
||||
"usage: shutdown [-dfhknr] [[[[[cc]yy]mm]dd]hh]mm [- | message ...]\n");
|
||||
(void)fprintf(stderr,
|
||||
" shutdown [-dfhknr] +time [message | -]\n");
|
||||
" shutdown [-dfhknr] +time [- | message ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user