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: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>, Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 27 Jan 2016 11:21:57 +0000
- 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>
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.
Thanks,
Pedro Alves