This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: igncr vs text mode mounts, performance vs compatibility


> >> Are you saying that these people expect bash to treat CRLF as if the
> >> CR were non-whitespace?  Can you give me an example where this would
> >> be a useful feature?
> 
> It may not be a well-used feature, but I won't go so far as to call it not
> useful.  One possible use - a script written with \n line endings, but
> which wants to intentionally generate an output file with \r\n line
> endings (this sounds like something sharutils might want to do).  On
> Linux, literal \r in a here-doc get output to the file.  So it stands to
> reason that someone might want to do the same action on cygwin when using
> a binary mount.  Since cygwin's goal is to provide a Linux emulation, I
> don't see any reason to artificially limit cygwin by making bash always
> ignore \r; rather, I think it is only safe to ignore \r when explicitly
> told to do so (either by a text mount, or by using igncr).

Just a thought, it would probably solve 99% of people's problems if you just
specified that if the first line of the script ends in \r\n, then \r will be
ignored for the rest of the file. Then you would just need to read the first
line a byte at a time, and every subsequent line could be read efficiently
whenever possible, right? And it seems unlikely that this could possibly break
anything.

-Lewis


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]