[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/3] tools/xl: make split_string_into_pair() more usable



On Wed, Mar 22, 2023 at 3:35 AM Juergen Gross <jgross@xxxxxxxx> wrote:
>
> Today split_string_into_pair() will not really do what its name is
> suggesting: instead of splitting a string into a pair of strings using
> a delimiter, it will return the first two strings of the initial string
> by using the delimiter.
>
> This is never what the callers want, so modify split_string_into_pair()
> to split the string only at the first delimiter found, resulting in
> something like "x=a=b" to be split into "x" and "a=b" when being called
> with "=" as the delimiter. Today the returned strings would be "x" and
> "a".
>
> At the same time switch the delimiter from "const char *" (allowing
> multiple delimiter characters) to "char" (a single character only), as
> this makes the function more simple without breaking any use cases.
>
> Suggested-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.