Matthieu Moy <matthieu....@grenoble-inp.fr> writes:

> Junio C Hamano <gits...@pobox.com> writes:
> 
> > Remi Lespinet <remi.lespi...@ensimag.grenoble-inp.fr> writes:
> >
> >> I agree, I'd like to put it right after split_at_commas in a separate
> >> function "trim_list". Is it a good idea even if the function is one
> >> line long ?
> >
> > Hmph, if I have "A, B, C" and call a function that gives an array of
> > addresses, treating the input as comma-separated addresses, I would
> > expect ("A", "B", "C") to be returned from that function, instead of
> > having to later trim the whitespace around what is returned.
> 
> It is actually doing this. But if you have " A,B,C  ", then you'll get
> " A", "B", "C  ". But once you're trimming around commas, trimming
> leading and trailing spaces fits well with split itself.

Yes and if we have a single address with leading or/and trailing
whitespaces, such as " A ", I think that we don't expect
split_in_commas to suppress these whitespaces as there's no commas in
this address. As Junio said, I think I should rename the function.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to