summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-10-24 05:42:34 +0000
committerache <ache@FreeBSD.org>1994-10-24 05:42:34 +0000
commitdebeeab73ab1f68cc58f35abeea7d1dfecb28f9d (patch)
treed85efd6a2fd19d367bbacb21b1f641b833f7680b /usr.bin/talk
parentf7e78facbba7d4aee12ff151def9e2bf26b1fb39 (diff)
downloadFreeBSD-src-debeeab73ab1f68cc58f35abeea7d1dfecb28f9d.zip
FreeBSD-src-debeeab73ab1f68cc58f35abeea7d1dfecb28f9d.tar.gz
Partially back out previous fix (in cases ':' and '!'),
leave case '.' as valid user name, not host reference. Document new behaviour.
Diffstat (limited to 'usr.bin/talk')
-rw-r--r--usr.bin/talk/get_names.c12
-rw-r--r--usr.bin/talk/talk.16
2 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c
index bde908a..0d1fcf1 100644
--- a/usr.bin/talk/get_names.c
+++ b/usr.bin/talk/get_names.c
@@ -79,17 +79,23 @@ get_names(argc, argv)
gethostname(hostname, sizeof (hostname));
my_machine_name = hostname;
/* check for, and strip out, the machine name of the target */
- for (cp = argv[1]; *cp && *cp != '@'; cp++)
+ for (cp = argv[1]; *cp && !index("@:!", *cp); cp++)
;
if (*cp == '\0') {
/* this is a local to local talk */
his_name = argv[1];
his_machine_name = my_machine_name;
} else {
+ if (*cp++ == '@') {
/* user@host */
his_name = argv[1];
- his_machine_name = cp + 1;
- *cp = '\0';
+ his_machine_name = cp;
+ } else {
+ /* host!user or host:user */
+ his_name = cp;
+ his_machine_name = argv[1];
+ }
+ *--cp = '\0';
}
if (argc > 2)
his_tty = argv[2]; /* tty name is arg 2 */
diff --git a/usr.bin/talk/talk.1 b/usr.bin/talk/talk.1
index 18c3304..2f40fa6 100644
--- a/usr.bin/talk/talk.1
+++ b/usr.bin/talk/talk.1
@@ -55,7 +55,11 @@ is just the person's login name. If you wish to talk to a user on
another host, then
.Ar person
is of the form
-.Ql user@host .
+.Ql user@host
+or
+.Ql host!user
+or
+.Ql host:user .
.It Ar ttyname
If you wish to talk to a user who is logged in more than once, the
.Ar ttyname
OpenPOWER on IntegriCloud