X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=str.c;h=13776300d6ca1aa62479df6be4428a5ba8d836a0;hp=623def1fd9b7aa7ee72f221aa6759fcf74b70948;hb=HEAD;hpb=5f5cd0b291c62b056c294cd947c00118572bc002;ds=sidebyside diff --git a/str.c b/str.c index 623def1..1377630 100644 --- a/str.c +++ b/str.c @@ -212,20 +212,21 @@ __must_check __malloc char *dss_logname(void) * * \param args The string to be split. * \param argv_ptr Pointer to the list of substrings. - * \param delim Delimiter. * - * This function modifies \a args by replacing each occurrence of \a delim by - * zero. A \p NULL-terminated array of pointers to char* is allocated dynamically - * and these pointers are initialized to point to the broken-up substrings - * within \a args. A pointer to this array is returned via \a argv_ptr. + * This function modifies the string given by the first argument by replacing + * all occurrences of space and '\t' characters by '\0'. A NULL-terminated + * array of pointers to char * is allocated dynamically, and these pointers are + * initialized to point to the broken-up substrings. A pointer to this array + * is returned via the last argument. * - * \return The number of substrings found in \a args. + * \return The number of substrings found. */ -unsigned split_args(char *args, char *** const argv_ptr, const char *delim) +unsigned split_args(char *args, char *** const argv_ptr) { char *p; char **argv; size_t n = 0, i, j; + const char delim[] = " \t"; p = args + strspn(args, delim); for (;;) {