Author: Robert Hyatt
Date: 08:25:40 09/17/98
Go up one level in this thread
On September 17, 1998 at 10:50:03, Peter Herttrich wrote: >On September 17, 1998 at 02:14:58, Keith Ian Price wrote: > >>On September 16, 1998 at 09:47:10, Robert Hyatt wrote: >> >>>For portability, I handle this inside crafty. When I read a line of input, >>>I always do something like this: >>> >>> if (strchr(buffer,'\r') *strchr(buffer,'\r')=' '; >>> >>>to remove the return and leave the \n... >>> >>>otherwise there are problems with dos/windows/macintosh/etc... >> >>I only mentioned it so that there would be a mention in the definition of the >>standard. You handle both cases, and I think this is the best way to do it. >> >>kp > >My two cents: Don't shoot me, if I'm wrong, but isn't the UNIX- >behavier (only linefeed at the end) Posix-Norm? >If yes, define it hard, to make coding easy, like Bob said. > >Peter correct. In fact, I don't believe that dos/windows programs do this either. yes, if you write to an ascii file, you get cr/lf on the end of lines, but I haven't noticed this in normal I/O. The only place I had problems with the \r character was in the Macintosh world, which seems to hold all standards in disdain for some reason... :)
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.