Re: [PATCH v4 01/11] argv_array: offer to split a string by whitespace

2018-04-23 Thread Junio C Hamano
Junio C Hamano writes: > Johannes Schindelin writes: > >> +void argv_array_split(struct argv_array *array, const char *to_split) >> +{ >> +while (isspace(*to_split)) >> +to_split++; >> +for (;;) { >> +const char *p = to_split; >> + >> +if (!*p) >> +

Re: [PATCH v4 01/11] argv_array: offer to split a string by whitespace

2018-04-23 Thread Junio C Hamano
Johannes Schindelin writes: > +void argv_array_split(struct argv_array *array, const char *to_split) > +{ > + while (isspace(*to_split)) > + to_split++; > + for (;;) { > + const char *p = to_split; > + > + if (!*p) > + break; > + > +

[PATCH v4 01/11] argv_array: offer to split a string by whitespace

2018-04-21 Thread Johannes Schindelin
This is a simple function that will interpret a string as a whitespace delimited list of values, and add those values into the array. Note: this function does not (yet) offer to split by arbitrary delimiters, or keep empty values in case of runs of whitespace, or de-quote Unix shell style. All fo