Re: Tutorial

Chris Angelico <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPTjJmpvwMpS2427VsOQsvn6CjRpH7srmHmHGkP-sd04zVFrxw@mail.gmail.com>
On Fri, Dec 9, 2016 at 9:22 AM, Peter Bortas <[email protected]> wrote:
>> Would it break the API? I mean, conceptually, it's retrieving a string
>> terminated by end-of-line. On Windows, "end-of-line" is often "\r\n".
>> Perhaps the solution is for gets to always strip off a trailing \r?
>> Bear in mind that this also applies to files that have CRLF endings,
>> not just stdin. I normally get around it by trimming whites, but it'd
>> be nice for it to just work.
>
> It would not break the documented API, but it would change what gets()
> returns on all OS. Maybe someone somewhere is feeding gets() with
> deliberate \r's at the end. To clarify: I am argumenting for breaking
> it though. Maybe even before 8.2.

Gotcha. Yeah, I understand that this shouldn't be changed in 8.0, just
because it is an incompatibility. But it's fulfilling the concept of
the function, so yep, change it in 8.1 IMO.

ChrisA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.