From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Junio C Hamano <gitster@pobox.com>
Cc: kusmabite@gmail.com, florian.achleitner.2.6.31@gmail.com,
GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 1/3] remote-testsvn.c: Avoid the getline() GNU extension function
Date: Thu, 30 Aug 2012 18:25:42 +0100 [thread overview]
Message-ID: <503FA216.8070704@ramsay1.demon.co.uk> (raw)
In-Reply-To: <7v3939wofb.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Erik Faye-Lund <kusmabite@gmail.com> writes:
>
>> On Sat, Aug 25, 2012 at 7:13 PM, Ramsay Jones
>> <ramsay@ramsay1.demon.co.uk> wrote:
>>>
>>> The getline() function is a GNU extension (you need to define
>>> _GNU_SOURCE before including stdio.h) and is, therefore, not
>>> portable. In particular, getline() is not available on MinGW.
>>
>> Actually, getline is a POSIX-2008 feature, so it's not (simply) a GNU extension:
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getline.html
>
> True, thanks for pointing it out. Justify the change with something
> like this instead, perhaps?
>
> The getline() function, even though is in POSIX.1-2008, is
> not available on some platforms. Use strbuf_getline() for
> portability.
>
> By the way, the remainder of the proposed log message talks about
> the difference between getline() that keeps the terminating LF vs
> strbuf_getline() that drops it. Would strbuf_getwholeline() be a
> better alternative?
I don't think it matters; I was just making sure Florian was aware
of the difference (it will not appear in the commit message anyway),
including the memory leak in the original code.
ATB,
Ramsay Jones
next prev parent reply other threads:[~2012-08-30 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-25 17:13 [PATCH 1/3] remote-testsvn.c: Avoid the getline() GNU extension function Ramsay Jones
2012-08-25 19:03 ` Joachim Schmitz
2012-08-25 19:20 ` Erik Faye-Lund
2012-08-26 17:31 ` Junio C Hamano
2012-08-30 17:25 ` Ramsay Jones [this message]
2012-08-30 17:19 ` Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=503FA216.8070704@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=florian.achleitner.2.6.31@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kusmabite@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.