--- mingetty.c.nohost Fri Dec 15 12:19:51 2000 +++ mingetty.c Fri Dec 15 13:02:00 2000 @@ -62,7 +62,7 @@ #include #include -#define LOGIN " login: " /* login prompt */ +#define LOGIN "login: " /* login prompt */ /* name of this program (argv[0]) */ static char *progname; @@ -80,6 +80,8 @@ static int noclear = 0; /* Print the whole string of gethostname() instead of just until the next "." */ static int longhostname = 0; +/* Print nothing of gethostname() instead of the other the other solutions */ +static int nohostname = 0; /* @@ -348,7 +350,10 @@ close (fd); } #endif - write (1, hn, strlen (hn)); + if (!nohostname) { + write (1, hn, strlen (hn)); + write (1, " ", 1); + } write (1, LOGIN, sizeof (LOGIN) - 1); } @@ -393,6 +398,7 @@ static struct option const long_options[] = { { "noclear", no_argument, &noclear, 1}, { "long-hostname", no_argument, &longhostname, 1}, + { "no-hostname", no_argument, &nohostname, 1}, { 0, 0, 0, 0 } }; @@ -424,6 +430,8 @@ } if (!longhostname && (s = strchr(hn, '.'))) *s = '\0'; + if (nohostname) + *hn = '\0'; tty = argv[optind]; if (! tty) usage (); --- mingetty.8.nohost Fri Jun 14 15:54:01 1996 +++ mingetty.8 Fri Dec 15 13:01:56 2000 @@ -3,7 +3,7 @@ mingetty \- minimal getty for consoles .SH SYNOPSIS .B mingetty -[\-\-noclear] [\-\-long\-hostname] +[\-\-noclear] [\-\-long\-hostname] [\-\-no\-hostname] .I tty .PP .SH DESCRIPTION @@ -26,6 +26,10 @@ .B \-\-long\-hostname By default the hostname is only printed until the first dot. With this option enabled, the full text from gethostname() is shown. +.TP +.B \-\-no\-hostname +By default the hostname is only printed until the first dot. +With this option enabled, nothing of the hostname is shown. .PP .SH "ISSUE ESCAPES" .B mingetty