On Wed, 22 Aug 2001 21:02:19 -0700, Greg Stein wrote:
>On Thu, Aug 23, 2001 at 02:01:47AM -0000, bjh@apache.org wrote:
>> bjh 01/08/22 19:01:47
>>
>> Modified: file_io/os2 readwrite.c
>> Log:
>> OS/2: change apr_file_gets() to leave the trailing \n on the string, matching
>> the output of the unix version. While I think it's dumb behaviour (I get sick
>> of removing it again in application code) at least it's consistently dumb :)
>
>You have to leave it on ... when you go to read in the last line of a file,
>the presence/absence of the '\n' will indicate whether the last line was
>terminated with \n or not.
>
>It may be dumb for many uses, but trimming it loses information...
True, but it's still annoying for the 99/100 cases where you don't give a
rat's. For the odd occasion where you do, I'd rather have an
apr_file_was_that_line_you_gave_me_LF_terminated?(apr_file_t *) function...
--
______________________________________________________________________________
| Brian Havard | "He is not the messiah! |
| brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian |
------------------------------------------------------------------------------
|