diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-09-17 22:41:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-09-17 22:41:27 +0000 |
commit | fa2cacba71627ee7dae4f57799141993273335e1 (patch) | |
tree | 1241a193e1c9adedb21b9e4a1a87bacd192f64b7 /usr.bin/tip/cu.c | |
parent | 5635d09e779e56fb7328c54a560c001b63707238 (diff) |
ensure that DV has a /dev/ in it
Diffstat (limited to 'usr.bin/tip/cu.c')
-rw-r--r-- | usr.bin/tip/cu.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/tip/cu.c b/usr.bin/tip/cu.c index c3a16c0401a..b0af51e2c86 100644 --- a/usr.bin/tip/cu.c +++ b/usr.bin/tip/cu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cu.c,v 1.7 2001/09/10 00:14:17 millert Exp $ */ +/* $OpenBSD: cu.c,v 1.8 2001/09/17 22:41:26 deraadt Exp $ */ /* $NetBSD: cu.c,v 1.5 1997/02/11 09:24:05 mrg Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: cu.c,v 1.7 2001/09/10 00:14:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: cu.c,v 1.8 2001/09/17 22:41:26 deraadt Exp $"; #endif /* not lint */ #include "tip.h" @@ -69,7 +69,16 @@ cumain(argc, argv) CU = optarg; break; case 'l': - DV = optarg; + if (DV != NULL) { + fprintf(stderr, + "%s: cannot specificy multiple -l options\n", + __progname); + exit(3); + } + if (strchr(optarg, '/')) + DV = optarg; + else + asprintf(&DV, "/dev/%s", optarg); break; case 's': l = strtol(optarg, &cp, 10); |