Date: Wed, 14 Nov 2001 09:06:40 -0800 (PST) From: Chris Williams <chris.williams@third-rail.net> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/31985: New /etc/remote flag for tip to append LF to CR Message-ID: <200111141706.fAEH6eH20700@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 31985 >Category: bin >Synopsis: New /etc/remote flag for tip to append LF to CR >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: wish >Submitter-Id: current-users >Arrival-Date: Wed Nov 14 09:10:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Chris Williams >Release: 4.2-STABLE >Organization: Third Rail >Environment: FreeBSD jello.geekspace.com 4.2-STABLE FreeBSD 4.2-STABLE #1: Mon Feb 12 09:52:41 But I think my sources are a bit newer, and I just never got around to building world..Doubt tip changes very much/often anyway. >Description: I have certain serial devices which require a ^M^J for eol. I couldn't find an existing way to make this happen when my terminal is just sending ^M, so I created a 'lf' option for tip. Patches below, in case someone agrees this might be useful. >How-To-Repeat: >Fix: diff -u /usr/src/usr.bin/tip/tip/remote.c ./remote.c --- /usr/src/usr.bin/tip/tip/remote.c Fri Aug 27 21:06:35 1999 +++ ./remote.c Wed Nov 14 11:48:22 2001 @@ -237,6 +237,8 @@ boolean(value(RAWFTP)) = 1; if (cgetflag("hd")) boolean(value(HALFDUPLEX)) = 1; + if (cgetflag("lf")) + boolean(value(LINEFEED)) = 1; if (RE == NOSTR) RE = (char *)"tip.record"; if (EX == NOSTR) diff -u /usr/src/usr.bin/tip/tip/tip.c ./tip.c --- /usr/src/usr.bin/tip/tip/tip.c Wed Jul 25 12:02:04 2001 +++ ./tip.c Wed Nov 14 11:52:02 2001 @@ -465,6 +465,10 @@ } else if (gch == '\r') { bol = 1; xpwrite(FD, &gch, 1); + if (boolean(value(LINEFEED))) { + gch = '\n'; + xpwrite(FD, &gch, 1); + } if (boolean(value(HALFDUPLEX))) printf("\r\n"); continue; diff -u /usr/src/usr.bin/tip/tip/tip.h ./tip.h --- /usr/src/usr.bin/tip/tip/tip.h Thu Sep 28 10:37:48 2000 +++ ./tip.h Wed Nov 14 11:49:07 2001 @@ -253,6 +253,7 @@ #define HALFDUPLEX 32 #define LECHO 33 #define PARITY 34 +#define LINEFEED 35 #define NOVAL ((value_t *)NULL) #define NOACU ((acu_t *)NULL) #define NOSTR ((char *)NULL) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111141706.fAEH6eH20700>