Re: Remove trailing \r when reading...

2003-01-08 Thread Lars Gullik Bjønnes
"Claus Hentschel" <[EMAIL PROTECTED]> writes: | > | > ios::text? No. It is a non-standard flag. | > | > ... | > | > ios::binary otoh is a standard flag and should work everywhere. | > | | > | So there seems not to be another way then removong those trailing \r's | the | > | way I'v done. We do nee

Re: Remove trailing \r when reading...

2003-01-08 Thread Claus Hentschel
> | > ios::text? No. It is a non-standard flag. > | > ... > | > ios::binary otoh is a standard flag and should work everywhere. > | > | So there seems not to be another way then removong those trailing \r's the > | way I'v done. We do need that in all cases where text read from a (binary) > | opene

Re: Remove trailing \r when reading...

2003-01-08 Thread Lars Gullik Bjønnes
"Claus Hentschel" <[EMAIL PROTECTED]> writes: | > | > Of course it could be done easier with | > | > ifstream ifs(tmp.c_str(), ios::in | ios::text); | > | > Maybe we should include that instead ;-) And we can rewrite all calls | to | > | > open a file for both reading and writing. | > | | > |

Re: Remove trailing \r when reading...

2003-01-08 Thread Claus Hentschel
> | > Of course it could be done easier with > | > ifstream ifs(tmp.c_str(), ios::in | ios::text); > | > Maybe we should include that instead ;-) And we can rewrite all calls to > | > open a file for both reading and writing. > | > | Does that work? No, not with gcc, because gcc is conform wit

Re: Remove trailing \r when reading...

2003-01-08 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Wed, Jan 08, 2003 at 09:55:18AM +0100, Claus Hentschel wrote: | > Lyx should run independent from the mode a drive is mounted. Therefore we | > need binary mode in some cases and text mode in some other cases whereas in | > most cases it doesn't matte

Re: Remove trailing \r when reading...

2003-01-08 Thread Andre Poenitz
On Wed, Jan 08, 2003 at 09:55:18AM +0100, Claus Hentschel wrote: > Lyx should run independent from the mode a drive is mounted. Therefore we > need binary mode in some cases and text mode in some other cases whereas in > most cases it doesn't matter. > > Of course it could be done easier with >

Re: Remove trailing \r when reading...

2003-01-08 Thread Claus Hentschel
> > Not with Win32! Have a look into src/support/os_win32.C. There > > os::read:mode() does return "rb" for Win32! > > I think this has nothing to do with the \r in LaTeX.C. There an ordinary > ifstream is used without giving the std::ios_base::binary flag, so this > should read in text mode. > > W

Re: Remove trailing \r when reading...

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 06:13:36PM +0100, Claus Hentschel wrote: > > > That's the reason! In Lyx we do open *all* files the same way, i.e. in > > > binary mode by default. > > > > No, the default mode is text. > > Not with Win32! Have a look into src/support/os_win32.C. There > os::read:mode() doe

Re: Remove trailing \r when reading...

2003-01-07 Thread Claus Hentschel
> > That's the reason! In Lyx we do open *all* files the same way, i.e. in > > binary mode by default. > > No, the default mode is text. Not with Win32! Have a look into src/support/os_win32.C. There os::read:mode() does return "rb" for Win32! > > To distinguish between text/binary mode we should

Re: Remove trailing \r when reading...

2003-01-07 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Jan 07, 2003 at 05:42:53PM +0100, Lars Gullik Bjønnes wrote: >> | That's the reason! In Lyx we do open *all* files the same way, i.e. in >> | binary mode by default. >> >> On a win box text mode is default... > | To be precise: text mode is ever

Re: Remove trailing \r when reading...

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 05:42:53PM +0100, Lars Gullik Bjønnes wrote: > | That's the reason! In Lyx we do open *all* files the same way, i.e. in > | binary mode by default. > > On a win box text mode is default... To be precise: text mode is everywhere default. But there is no difference between t

Re: Remove trailing \r when reading...

2003-01-07 Thread Lars Gullik Bjønnes
"Claus Hentschel" <[EMAIL PROTECTED]> writes: | > Lars> Andre Poenitz <[EMAIL PROTECTED]> writes: | > Lars> | On Tue, Jan 07, 2003 at 12:31:00PM +0100, Andre' Poenitz wrote: | > Lars> | > I just got confirmation from de.comp.lang.iso-c++ that | > | > Lars> getline() should never return the '\r' if

Re: Remove trailing \r when reading...

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 05:27:33PM +0100, Claus Hentschel wrote: > > Lars> Andre Poenitz <[EMAIL PROTECTED]> writes: > > Lars> | On Tue, Jan 07, 2003 at 12:31:00PM +0100, Andre' Poenitz wrote: > > Lars> | > I just got confirmation from de.comp.lang.iso-c++ that | > > > Lars> getline() should never

Re: Remove trailing \r when reading...

2003-01-07 Thread Claus Hentschel
> Lars> Andre Poenitz <[EMAIL PROTECTED]> writes: > Lars> | On Tue, Jan 07, 2003 at 12:31:00PM +0100, Andre' Poenitz wrote: > Lars> | > I just got confirmation from de.comp.lang.iso-c++ that | > > Lars> getline() should never return the '\r' if the stream is in | > > Lars> text mode. That's the re

Re: Remove trailing \r when reading...

2003-01-07 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> Andre Poenitz <[EMAIL PROTECTED]> writes: Lars> | On Tue, Jan 07, 2003 at 12:31:00PM +0100, Andre' Poenitz wrote: Lars> | > I just got confirmation from de.comp.lang.iso-c++ that | > Lars> getline() should never return the '\r'

Re: Remove trailing \r when reading...

2003-01-07 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Jan 07, 2003 at 12:31:00PM +0100, Andre' Poenitz wrote: | > I just got confirmation from de.comp.lang.iso-c++ that | > getline() should never return the '\r' if the stream is in | > text mode. | | Next asnwer says: This is a well-known bug

Re: Remove trailing \r when reading...

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 12:31:00PM +0100, Andre' Poenitz wrote: > I just got confirmation from de.comp.lang.iso-c++ that > getline() should never return the '\r' if the stream is in > text mode. Next asnwer says: This is a well-known bug in some Borland Compiler ("BCB5"). Upgrading or using

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 12:43:14PM +0100, Jean-Marc Lasgouttes wrote: > Andre> It shouldn't for the common case of putting the line into > Andre> istringstream and reading from there. > > Why? What is the magic making this happen? "The streambuffer layer". I have asked what this means ;-) Andre'

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> On Tue, Jan 07, 2003 at 10:37:19AM +0100, Lars Gullik Bjønnes Andre> wrote: >> all calls to getline is followed by a call to rtrim... Andre> Indeed. Andre> I now just wonder why the removal of the '\r' is necessary at Andre> all.

Remove trailing \r when reading...

2003-01-07 Thread Andre Poenitz
I just got confirmation from de.comp.lang.iso-c++ that getline() should never return the '\r' if the stream is in text mode. So which compiler was that? The only possibility is a '\r\r\n' in the raw input... Andre' -- Those who desire to give up Freedom in order to gain Security, will

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> Andre Poenitz <[EMAIL PROTECTED]> writes: Lars> | On Mon, Jan 06, 2003 at 09:41:01PM +0100, Lars Gullik Bjønnes wrote: Lars> | > | A single char obviously can't be '\r\n'. So I'd indeed Lars> expect a '\r' at the | > | end of th

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Jan 07, 2003 at 10:37:19AM +0100, Lars Gullik Bjønnes wrote: | > all calls to getline is followed by a call to rtrim... | | Indeed. | | I now just wonder why the removal of the '\r' is necessary at all. | | It shouldn't for the common case of

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | I wonder what happens if we used | | getline(s,n,widen('\n')) This is just what getline(s, n) ends up in. -- Lgb

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 10:44:52AM +0100, Jean-Marc Lasgouttes wrote: > Andre> The problem is, not to many people here have a Windows > Andre> development system to check. The ifstream in question is not > Andre> opened in binary mode as far as I can tell, so optically it > Andre> should work. Neve

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Andre Poenitz
On Tue, Jan 07, 2003 at 10:37:19AM +0100, Lars Gullik Bjønnes wrote: > all calls to getline is followed by a call to rtrim... Indeed. I now just wonder why the removal of the '\r' is necessary at all. It shouldn't for the common case of putting the line into istringstream and reading from there.

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> The problem is, not to many people here have a Windows Andre> development system to check. The ifstream in question is not Andre> opened in binary mode as far as I can tell, so optically it Andre> should work. Nevertheless, the '\r'

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-07 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Mon, Jan 06, 2003 at 09:41:01PM +0100, Lars Gullik Bjønnes wrote: | > | A single char obviously can't be '\r\n'. So I'd indeed expect a '\r' at the | > | end of the string read by getline(...'\n') -- unless this has something | > | to do with that 'bi

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-06 Thread Andre Poenitz
On Mon, Jan 06, 2003 at 09:41:01PM +0100, Lars Gullik Bjønnes wrote: > | A single char obviously can't be '\r\n'. So I'd indeed expect a '\r' at the > | end of the string read by getline(...'\n') -- unless this has something > | to do with that 'binary mode' vs 'text mode' and the \r is removed ear

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-06 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | A single char obviously can't be '\r\n'. So I'd indeed expect a '\r' at the | end of the string read by getline(...'\n') -- unless this has something | to do with that 'binary mode' vs 'text mode' and the \r is removed earlier. | Somehow... This is exac

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-06 Thread Andre Poenitz
On Mon, Jan 06, 2003 at 06:43:28PM +0100, Lars Gullik Bjønnes wrote: > I am not sure why this patch is needed. I thought that a standard > conforming ifstream + getline would remove the line ending on the > system it runs. Thus in the case of win32 it should remove \r\n. Hm. template basic_

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-06 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | Lars> The following patch is adapted from one of the last bits in the Lars> patch | that Claus Hentschel uses on win32. It fixes parsing of Lars> log files by | removing trailin

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-06 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | The following patch is adapted from one of the last bits in the patch | that Claus Hentschel uses on win32. It fixes parsing of log files by | removing trailing \r. | | OK to apply? Not sure... I am not sure why this patch is needed. I thought

Re: [PATCH] Remove trailing \r when reading log files (for win32)

2003-01-06 Thread Jean-Marc Lasgouttes
> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: Jean-Marc> The following patch is adapted from one of the last bits in Jean-Marc> the patch that Claus Hentschel uses on win32. It fixes Jean-Marc> parsing of log files by removing trailing \r. Jean-Marc> OK to apply? Lars, ca

[PATCH] Remove trailing \r when reading log files (for win32)

2002-12-20 Thread Jean-Marc Lasgouttes
The following patch is adapted from one of the last bits in the patch that Claus Hentschel uses on win32. It fixes parsing of log files by removing trailing \r. OK to apply? JMarc ? config.h.in ? src/ext_l10n.h Index: src/ChangeLog =