Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 2 Oct 2002 21:37:04 +0200 From: "Gerrit P. Haase" Organization: Esse keine toten Tiere X-Priority: 3 (Normal) Message-ID: <67477092222.20021002213704@familiehaase.de> To: Bertie CC: cygwin AT cygwin DOT com Subject: Re: Incorrect DOS line ending conversion for cygwin build of perl In-Reply-To: <3.0.1.32.20021002143318.02cd2270@mail.ncipher.com> References: <3 DOT 0 DOT 1 DOT 32 DOT 20021002143318 DOT 02cd2270 AT mail DOT ncipher DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hallo Bertie, Am Mittwoch, 2. Oktober 2002 um 15:33 schriebst du: > I note that the cygwin build of perl does not correctly translate DOS \r\n > line endings into \n when opening files in text mode, this causes all sorts > of grief in perl scripts which search for things like fred$ in DOS text > files. > After a bit of digging around in perl source it turns out that the problem > is in the function str_gets() in x2p/str.c, this code uses the FILE *fp->_p > variable to read directly from the FILE buffer, but alas cygwin only does > the \r\n -> \n conversion when serving up the contents of the _p buffer ( > in fread, fgets, fgetc etc ), not before, so reading the _p buffer directly > circumvents the translation. > There is a perl variable USE_STDIO_PTR which can be undefined to stop perl > from using the FILE _p variable. I have built a cygwin version of perl with > this undefined and the line ending conversion now works fine. > You might consider this to be a bug in the perl build system (USE_STDIO_PTR > should be undefined by default for cygwin builds), however at the very > least cygwin should ship a version of perl which has been built correctly. > Alternatively cygwin could be altered to do the line ending conversion > before putting data into FILE *fp->_p, I imagine this might cause slight > upheaval though. Which version of perl do you use? Have you tried to build perl with -UUSE_STDIO_PTR? Does it work as expected by you? Gerrit -- =^..^= -- 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/