diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1994-10-24 03:48:44 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1994-10-24 03:48:44 +0000 |
commit | 016d2992055272e888e13bcd33d224e617456e74 (patch) | |
tree | 641001591405d3a6bdfd042e9bbe69221c3375dc /usr.bin/talk | |
parent | 302a30b002924132affc7823c37ab9844e5be485 (diff) | |
download | src-016d2992055272e888e13bcd33d224e617456e74.tar.gz src-016d2992055272e888e13bcd33d224e617456e74.zip |
Remove undocumented talk behaviour, when names like
aa.bb aa:bb and aa!bb treated as user+host and not as local user
names (especially aa.bb is common case).
Only @ is valid user/host separator according to manpage.
Pointed-by: doctor@dream.demos.su
Notes
Notes:
svn path=/head/; revision=3823
Diffstat (limited to 'usr.bin/talk')
-rw-r--r-- | usr.bin/talk/get_names.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c index 9d3cc04c01b9..bde908ac2d32 100644 --- a/usr.bin/talk/get_names.c +++ b/usr.bin/talk/get_names.c @@ -79,23 +79,17 @@ 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 && !index("@:!.", *cp); cp++) + for (cp = argv[1]; *cp && *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; - } else { - /* host.user or host!user or host:user */ - his_name = cp; - his_machine_name = argv[1]; - } - *--cp = '\0'; + his_machine_name = cp + 1; + *cp = '\0'; } if (argc > 2) his_tty = argv[2]; /* tty name is arg 2 */ |