From: Vadim Antonov avg@postman.ncube.com
Subject: telnetd improvements
Date: Mon, 14 Aug 1995 07:57:54 -0400 [thread overview]
Message-ID: <19950814115754.bAROQy4oOC9h4qrLyFHQhFGlNlI3iZ15oFk_fdGM65I@z> (raw)
Hi -- i fixed the telnetd "line discipline" to make it more convinient
for those who telnet into a Plan 9 system (i.e. it simulates the
BSD-style kill/erase behaviour). Diffs (from 2.0 source) are:
cpu% cd /sys/src/cmd/service
cpu% diff telnetd.c.old telnetd.c
273a274,276
> #define BACKSPACE() { ECHO('\b'); ECHO(' '); ECHO('\b'); }
> #define RUBOUT(c) { BACKSPACE(); if((c)<' ' || (c)==0177) BACKSPACE(); }
>
347,350d349
< case 0x00:
< if(noproto) /* telnet ignores nulls */
< *bp++ = c;
< continue;
357c356
< if(start < bp)
---
> if(start < bp) {
359,360c358,360
< if(opt[Echo].local)
< ECHO(c);
---
> if(opt[Echo].local)
> RUBOUT(*bp);
> }
364,369c364,368
< bp = start;
< if(opt[Echo].local){
< ECHO('^');
< ECHO('U');
< ECHO('\r');
< ECHO('\n');
---
> if(opt[Echo].local) {
> while (bp > start) {
> bp--;
> RUBOUT(*bp);
> }
375,378c374
< while (--bp >= start && !alnum(*bp))
< ECHO('\b');
< while (bp >= start && alnum(*bp)) {
< ECHO('\b');
---
> while (bp > start && !alnum(bp[-1])) {
379a376
> RUBOUT(*bp);
381c378,381
< bp++;
---
> while (bp > start && alnum(bp[-1])) {
> bp--;
> BACKSPACE();
> }
386a387,389
> ECHO('\r');
> ECHO('\n');
> bp = start;
388a392,396
> case 0x00:
> if(!noproto) /* telnet ignores nulls */
> break;
> /*FALL THRU*/
>
390,391c398,405
< if(opt[Echo].local)
< ECHO(c);
---
> if(opt[Echo].local) {
> if( c >= ' ' ) {
> ECHO(c);
> } else {
> ECHO('^');
> ECHO(0x40|c);
> }
> }
cpu%
--vadim
reply other threads:[~1995-08-14 11:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19950814115754.bAROQy4oOC9h4qrLyFHQhFGlNlI3iZ15oFk_fdGM65I@z \
--to=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).