[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please consider these 2 changesets
From: |
Michael Goffioul |
Subject: |
Re: Please consider these 2 changesets |
Date: |
Wed, 23 Apr 2008 20:56:20 +0200 |
On Wed, Apr 23, 2008 at 5:18 PM, John W. Eaton <address@hidden> wrote:
> On 23-Apr-2008, Michael Goffioul wrote:
>
> | Please consider the following changesets for inclusion into
> | main octave archive. One of them fixes the CRLF problem
> | I reported earlier (basically, the problem is that MSVC messes
> | up things with ftell/fseek for files opened in text-mode, hence
> | with CRLF translation).
>
> That change is:
>
> | diff -r 5d199a0677d4 -r a54a89d2608e src/ChangeLog
> | --- a/src/ChangeLog Wed Apr 23 16:58:10 2008 +0200
> | +++ b/src/ChangeLog Wed Apr 23 16:58:48 2008 +0200
> | @@ -1,3 +1,8 @@ 2008-04-20 John W. Eaton <address@hidden
> | +2008-04-23 Michael Goffioul <address@hidden>
> | +
> | + * input.cc (get_input_from_file): Open file in binary mode (overwrite
> | + default mode under MSVC).
> | +
> | 2008-04-20 John W. Eaton <address@hidden>
> |
> | * oct-stream.cc (octave_stream::read): Allow single data type
> | diff -r 5d199a0677d4 -r a54a89d2608e src/input.cc
> | --- a/src/input.cc Wed Apr 23 16:58:10 2008 +0200
> | +++ b/src/input.cc Wed Apr 23 16:58:48 2008 +0200
> | @@ -398,7 +398,7 @@ get_input_from_file (const std::string&
> | FILE *instream = 0;
> |
> | if (name.length () > 0)
> | - instream = fopen (name.c_str (), "r");
> | + instream = fopen (name.c_str (), "rb");
> |
> | if (! instream && warn)
> | warning ("%s: no such file or directory", name.c_str ());
>
> What affect does this have for OS X, where text files by default use
> '\r' for line termination? I'm not sure that Octave's lexer can
> handle those files properly if they are opened in binary mode.
It's hard for me to tell, as I don't have Mac OS X. Does Mac OS C
do also translations between CR/LF when the file is opened in
text mode? What is the default open mode under Mac OS X
(under Windows, it's text mode by default).
The problem with text-mode under Windows is that ftell/fseek
do not work correctly. And I don't see another easy solution
to avoid that problem.
Michael.