This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Introduce skip_to_char and use it


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]