svn commit: r315418 - in head/sys/teken: . libteken

Bruce Evans brde at optusnet.com.au
Thu Mar 16 18:55:18 UTC 2017


On Thu, 16 Mar 2017, Oliver Pinter wrote:

> On 3/16/17, Bruce Evans <brde at optusnet.com.au> 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 at 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


More information about the svn-src-head mailing list