2009/6/26 Sam Steingold <sds@...>:
> Reini Urban wrote:
>> 2009/6/25 Sam Steingold <sds@...>:
>>> Reini Urban wrote:
>>>> $ `./foo b`
>>>> bash: $'("b")\r': command not found
>>>> A terminal issue with cygwin still trying to print "\r\n"
>>> yes, and somehow bash is trying to run the output of `./foo b`
>>>> I think I've patched that in my release.
>>> so, where is the patch?
>> What I always complained about.
>> diff -u src/encoding.d.orig src/encoding.d
>> --- src/encoding.d.orig 2008-11-03 15:13:38.000000000 +0100
>> +++ src/encoding.d 2009-06-26 08:53:40.500000000 +0200
>> @@ -2580,7 +2580,7 @@
>> unused name; unused context;
>> pushSTACK(unbound); /* :charset */
>> #endif /* UNICODE */
>> - #if defined(WIN32) || (defined(UNIX) && (O_BINARY != 0))
>> + #if defined(WIN32) && !defined(__CYGWIN__)
>> pushSTACK(S(Kdos)); /* :line-terminator */
>> pushSTACK(S(Kunix)); /* :line-terminator */
>> The default :DOS line-terminator on cygwin is just wrong.
>> If someone wants to read DOS textfiles he has to specifiy the encoding
> since the users of clisp output on a win32 machine are win32 programs which
> expect CRLF, that's what we should use.
> since CLISP understands all possible line terminators on input
> (see Section 13.10, “Treatment of Newline during Input and Output ”),
> all that matters is what line terminator
> do most other programs expect?
It's not a matter of understanding.
It's a matter of sane defaults, and crlf on cygwin is unsane.
Shell scripts containing crlf will fail, clisp should also default to lf.
The win32 default is crlf, cygwin's default is LF only.
Since the users of clisp output on cygwin are cygwin programs which
expect LF, that's what we should use.
See the typical bash announcement:
3. Cygwin text mounts automatically work with either line ending style,
because the \r is stripped before bash reads the file. If you absolutely
must use files with \r\n line endings, consider mounting the directory
where those files live as a text mount. However, text mounts are not as
well tested or supported on the cygwin mailing list, so you may encounter
other problems with other cygwin tools in those directories.
4. This version of bash has a cygwin-specific shell option, named "igncr"
to force bash to ignore \r, independently of cygwin's mount style. As of
bash-3.2.3-5, it controls regular scripts, command substitution, and
sourced files. I hope to convince the upstream bash maintainer to accept
this patch into the future bash 4.0 even on Linux, rather than keeping it
a cygwin-specific patch, but only time will tell. There are several ways
to activate this option:
Almost nobody uses textmounts and igncr nowadays.
There's also strong support of removing textmounts at all.
>> clisp used in pipes is broken with \r.
> we should just strip \r from output here, like we do everywhere else on
> I committed a patch to that effect.
Thanks, but this is of no help at all. The default line-terminator on
output is still
crlf which forbids using clisp in pipes e.g.