Mail Archives: cygwin/2002/09/10/07:22:13
---MOQ1031656920aa0c60cdbf9d239307144665908e8998
Content-Type: text/plain; charset=windows-1252;q=1.0
Content-Transfer-Encoding: 8bit
Quoting Corinna Vinschen <corinna-cygwin AT cygwin DOT com>:
> On Tue, Sep 10, 2002 at 08:01:00AM +0200, Dan Vasaru wrote:
> > I'll give this a go in gdb as it seems to have caused problems for some
> > users. Did you just remove the fd_is_seekable ifdef ?
> Yes, I announced -5 yesterday, reverting that again.
The problem is with the way text seeks are (not) implemented in cygwin: lseek in text files do not adjust for skipped CRs. This is also the strategy MS is using in their CRT, so it may be the most MSVCRT/CYGWIN compatible solution.
So it seems that applications that use lseek on text files should handle CRLF translation by themselves, at least for now.
In the case of bash, CRLF translation seems to have been implemented by the DJGPP port.
I just removed (almost) all __CYGWIN__ textmode translation related #ifdefs, and enabled the DJGPP CR removal hack in buffered_getchar ().
Preliminary testing shows the new bash to work on both CRLF and LF files.
Files are no longer opened in O_TEXT mode, but CR's are stripped in buffered_getchar.
In case anyone is interested in testing out the new bash, I'm attaching a diff to bash-2.05b-3-src.tar.bz2, and I can provide a prebuilt bash.exe.
dan
---MOQ1031656920aa0c60cdbf9d239307144665908e8998
Content-Type: application/octet-stream; name="bashdiff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bashdiff"
ZGlmZiAtcmMgYmFzaC0yLjA1Yi0zL2J1aWx0aW5zL2V2YWxmaWxlLmMgYmFzaC0yLjA1Yi02L2J1
aWx0aW5zL2V2YWxmaWxlLmMKKioqIGJhc2gtMi4wNWItMy9idWlsdGlucy9ldmFsZmlsZS5jCVRo
dSBGZWIgMjEgMjE6MDg6NTIgMjAwMgotLS0gYmFzaC0yLjA1Yi02L2J1aWx0aW5zL2V2YWxmaWxl
LmMJVHVlIFNlcCAxMCAxMjo0MzoxOSAyMDAyCioqKioqKioqKioqKioqKgoqKiogMTIxLDEzMCAq
KioqCiAgICAgICAgcmV0dXJuICgoZmxhZ3MgJiBGRVZBTF9C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9uIERKR1BQLCBpZ25vcmUgXHIuICovCmRpZmYgLXJjIGJhc2gtMi4wNWItMy9zaGVsbC5jIGJh
c2gtMi4wNWItNi9zaGVsbC5jCioqKiBiYXNoLTIuMDViLTMvc2hlbGwuYwlNb24gSnVsICAxIDE3
OjI3OjExIDIwMDIKLS0tIGJhc2gtMi4wNWItNi9zaGVsbC5jCVR1ZSBTZXAgMTAgMTI6NDM6MTkg
MjAwMgoqKioqKioqKioqKioqKioKKioqIDEzNDMsMTM1MiAqKioqCiAgICAgICBub3QgbWF0Y2gg
d2l0aCBvdXJzLiAqLwogICAgZmQgPSBtb3ZlX3RvX2hpZ2hfZmQgKGZkLCAwLCAtMSk7CiAgCi0g
I2lmIGRlZmluZWQgKF9fQ1lHV0lOX18pICYmIGRlZmluZWQgKE9fVEVYVCkKLSAgIHNldG1vZGUg
KGZkLCBPX1RFWFQpOwotICNlbmRpZgotIAogICNpZiBkZWZpbmVkIChCVUZGRVJFRF9JTlBVVCkK
ICAgIGRlZmF1bHRfYnVmZmVyZWRfaW5wdXQgPSBmZDsKICAgIFNFVF9DTE9TRV9PTl9FWEVDIChk
ZWZhdWx0X2J1ZmZlcmVkX2lucHV0KTsKLS0tIDEzNDMsMTM0OCAtLS0tCg==
---MOQ1031656920aa0c60cdbf9d239307144665908e8998
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
---MOQ1031656920aa0c60cdbf9d239307144665908e8998--
- Raw text -