m5term: assume localhost if host name not provided.
util/term/term.c: Reindent. util/term/term.c: Assume localhost if only port number is given on command line. --HG-- extra : convert_revision : 768e61a56339a0795ca258cca788e9a2c20cbaae
This commit is contained in:
parent
780aa0a0eb
commit
3772e4fc97
1 changed files with 140 additions and 137 deletions
|
@ -74,12 +74,15 @@ main(int argc, char *argv[])
|
|||
strncpy(progname, argv[0], sizeof progname);
|
||||
|
||||
/* Cruft to make sure options are clean, and used properly. */
|
||||
if (argc != 3 || !argv[1] || !argv[2])
|
||||
usage(1);
|
||||
|
||||
if (argc == 2) {
|
||||
host = "localhost";
|
||||
port = argv[1];
|
||||
} else if (argc == 3) {
|
||||
host = argv[1];
|
||||
port = argv[2];
|
||||
|
||||
} else {
|
||||
usage(1);
|
||||
}
|
||||
|
||||
if (!isatty(STDIN_FILENO))
|
||||
errx(1, "not attached to a terminal");
|
||||
|
|
Loading…
Reference in a new issue