[PATCH v2] New common function "startswith"

Joel Brobecker brobecker@adacore.com
Thu Mar 5 18:18:00 GMT 2015


> This patch introduces a new inline common function "startswith"
> which takes two string arguments and returns nonzero if the first
> string starts with the second.  It also updates the 295 places
> where this logic was written out longhand to use the new function.
> 
> Changes from the first version are:
> 
>  - The function is now inline.
>  - The arguments got renamed to "string" and "pattern".
>  - I found 115 more places to use it.
> 
> Regression tested on RHEL 6.6 x86_64.
> 
> Ok to commit?
> --
> gdb/ChangeLog:
> 
> 	* common/common-utils.h (startswith): New inline function.
> 	All places where this logic was used updated to use the above.

I didn't read the entire file all that carefully, just the first
few pages of it. If it was a mechanical change, and then tested
as you say, it's good enough for me, I think.

OK to push!

Thank you,
-- 
Joel



More information about the Gdb-patches mailing list