This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Introduce skip_to_char and use it
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 27 Jan 2016 13:04:09 -0500
- Subject: Re: [PATCH] Introduce skip_to_char and use it
- Authentication-results: sourceware.org; auth=none
- References: <1453845250-30360-1-git-send-email-simon dot marchi at ericsson dot com> <878u3b24f8 dot fsf at redhat dot com> <56A8A855 dot 8050208 at redhat dot com>
On Wednesday, January 27 2016, Pedro Alves wrote:
> On 01/27/2016 01:32 AM, Sergio Durigan Junior wrote:
>
>> The problem with skip_to_char IMO is that it leads the reader to believe
>> that this function performs the same job as strchr (in fact, my first
>> reaction when I read this introduction was to think "why not use
>> strchr?"). The main difference, however, is that this function actually
>> skips everything if the char was not found.
>>
>> I believe a name like "skip_to_char_or_nul" may be more appropriate.
>> What do you think?
>
> That sounds just like strchrnul, though. It's not available everywhere,
> but, gnulib has a strchrnul module that fixes that.
Even better. Thank you, Pedro.
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/