This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use strtok_r instead of strsep in rust_get_disr_info
- From: Pedro Alves <palves at redhat dot com>
- To: Manish Goregaokar <manish at mozilla dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tom at tromey dot com>
- Date: Wed, 29 Jun 2016 11:44:30 +0100
- Subject: Re: [PATCH] Use strtok_r instead of strsep in rust_get_disr_info
- Authentication-results: sourceware.org; auth=none
- References: <CAFOnWkmN-uBB8iDjMaLpe=0SxWecFXxvvgfG2-FJn3j2XbBZJA at mail dot gmail dot com> <e349e31f-74b5-a2fa-b82b-5cbb6d548f16 at redhat dot com> <CAFOnWk=a2g-XEtsFjXp85DhTSmT4fVNSkWLuAa0WoS9JY_XM=w at mail dot gmail dot com> <7ab96fcb-ffcd-c1ec-187d-f8ec05e43923 at redhat dot com> <CAFOnWkkFv0p8sZk71xDptmVH74cQUCyfL-AKP5iBY0D02XB8PA at mail dot gmail dot com>
On 06/29/2016 11:38 AM, Manish Goregaokar wrote:
> strsep moves the pointer to the end of the string. We want to ensure
> the early break happens, since we need token to contain the name of
> the variant at this stage.
>
> strtok doesn't do this. However, strtok does make it NULL, which we
> don't want either. I added a check for it in my most recent email,
> tests still pass.
Right, that one is OK. Please push.
Thanks,
Pedro Alves