diff options
Diffstat (limited to 'bin/mt')
-rw-r--r-- | bin/mt/mt.1 | 4 | ||||
-rw-r--r-- | bin/mt/mt.c | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/bin/mt/mt.1 b/bin/mt/mt.1 index 645886d893a..ef22cbd3c5e 100644 --- a/bin/mt/mt.1 +++ b/bin/mt/mt.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mt.1,v 1.5 1996/06/12 07:50:57 downsj Exp $ +.\" $OpenBSD: mt.1,v 1.6 1996/06/17 02:21:50 downsj Exp $ .\" $NetBSD: mt.1,v 1.8 1996/05/21 10:23:55 mrg Exp $ .\" .\" Copyright (c) 1981, 1990, 1993 @@ -48,7 +48,7 @@ .Op Ar count .Nm eject .Op Fl f -.Op Ar tapename +.Ar tapename .Sh DESCRIPTION .Nm Mt is used to give commands to a magnetic tape drive. diff --git a/bin/mt/mt.c b/bin/mt/mt.c index 0e4e0768897..1497773a75b 100644 --- a/bin/mt/mt.c +++ b/bin/mt/mt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mt.c,v 1.7 1996/06/12 07:58:41 downsj Exp $ */ +/* $OpenBSD: mt.c,v 1.8 1996/06/17 02:21:53 downsj Exp $ */ /* $NetBSD: mt.c,v 1.14.2.1 1996/05/27 15:12:11 mrg Exp $ */ /* @@ -126,11 +126,13 @@ main(argc, argv) else progname = argv[0]; - if (strcmp(progname, "eject") == 0) + if (strcmp(progname, "eject") == 0) { eject = 1; - - if ((tape = getenv("TAPE")) == NULL) - tape = DEFTAPE; + tape = NULL; + } else { + if ((tape = getenv("TAPE")) == NULL) + tape = DEFTAPE; + } while ((ch = getopt(argc, argv, "f:t:")) != -1) { switch (ch) { @@ -157,6 +159,9 @@ main(argc, argv) } else if (argc < 1 || argc > 2) usage(); + if (tape == NULL) + usage(); + if (strchr(tape, ':')) { host = tape; tape = strchr(host, ':'); |