summaryrefslogtreecommitdiffstats
path: root/bin/domainname
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-09-26 02:14:27 +0000
committerwollman <wollman@FreeBSD.org>1994-09-26 02:14:27 +0000
commit654b618563dd80f83ec0e68e054d4a5971683ed1 (patch)
tree954483a4024904ebf9921c0d92994cb9bf8af668 /bin/domainname
parentbbe71d3b98e0c9abba3c0615fb8b83b7d9caf06a (diff)
downloadFreeBSD-src-654b618563dd80f83ec0e68e054d4a5971683ed1.zip
FreeBSD-src-654b618563dd80f83ec0e68e054d4a5971683ed1.tar.gz
Actually implement this correctly.
Diffstat (limited to 'bin/domainname')
-rw-r--r--bin/domainname/domainname.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bin/domainname/domainname.c b/bin/domainname/domainname.c
index 0a08f73..77a5a86 100644
--- a/bin/domainname/domainname.c
+++ b/bin/domainname/domainname.c
@@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "From: @(#)hostname.c 8.1 (Berkeley) 5/31/93"; */
static const char rcsid[] =
- "$Id: domainname.c,v 1.2 1994/09/20 06:20:39 phk Exp $";
+ "$Id: domainname.c,v 1.3 1994/09/21 22:30:55 bde Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -56,10 +56,9 @@ main(argc,argv)
int argc;
char *argv[];
{
- int sflag;
char *p, domainname[MAXHOSTNAMELEN];
- sflag = 0;
+ argc--, argv++;
if (*argv) {
if (setdomainname(*argv, strlen(*argv)))
@@ -67,8 +66,6 @@ main(argc,argv)
} else {
if (getdomainname(domainname, sizeof(domainname)))
err(1, "getdomainname");
- if (sflag && (p = strchr(domainname, '.')))
- *p = '\0';
(void)printf("%s\n", domainname);
}
exit(0);
OpenPOWER on IntegriCloud