From owner-svn-src-head@freebsd.org Thu Mar 16 18:55:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BC72D0F151; Thu, 16 Mar 2017 18:55:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4D7103C; Thu, 16 Mar 2017 18:55:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 069233C3A51; Fri, 17 Mar 2017 05:55:08 +1100 (AEDT) Date: Fri, 17 Mar 2017 05:55:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Oliver Pinter cc: Bruce Evans , Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r315418 - in head/sys/teken: . libteken In-Reply-To: Message-ID: <20170317055036.D27477@besplex.bde.org> References: <201703161640.v2GGes8N033822@repo.freebsd.org> <20170317040832.N26977@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=VG8G3FbURGeNryjcWkYA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 18:55:18 -0000 On Thu, 16 Mar 2017, Oliver Pinter wrote: > On 3/16/17, Bruce Evans wrote: >> On Thu, 16 Mar 2017, Bruce Evans wrote: >> >>> Log: >>> Add teken_256to16() to convert xterm-256 256-color codes to xterm >>> 16-color >>> codes. This will be used to fix bright colors. >>> >>> Improve teken_256to8(). Use a lookup table instead of calculations. >>> The >>> ... >> >> A shell script for printing some text color maps is attached. Also a >> sloppier one for printing some CSI sequences. >> ... > > If I'm not wrong, these scripts where made on OS X. They use \r\n line endings, > and this triggers random cryptic runtime errors: > > op@opn /tmp> sh -x sc-vt-CSI > + printf $'\\033[m\r' > + printf $'\\033[x\r' > sc-vt-CSI: 5: Syntax error: word unexpected > > The simple fix is to delete the '\r's from the scripts: > > cat sc-vt-CSI | tr -d '\r' > trans.sh No OS X here. It means that some mailers mangle even attachments. Shells should probably accept \r\n as newline on systems where this is not the native newline. Some C compilers do. Bruce