{
pid_t pid;
char **argv, *tmp = dss_strdup(OPT_STRING_VAL(DSS, EXIT_HOOK));
- unsigned n = split_args(tmp, &argv, " \t");
+ unsigned n = split_args(tmp, &argv);
n++;
argv = dss_realloc(argv, (n + 1) * sizeof(char *));
{
char **argv, *tmp = dss_strdup(cmdline);
- split_args(tmp, &argv, " \t");
+ split_args(tmp, &argv);
dss_exec(pid, argv[0], argv);
free(argv);
free(tmp);
*
* \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 (;;) {
__must_check __malloc char *get_homedir(void);
int dss_atoi64(const char *str, int64_t *value);
__must_check __malloc char *dss_logname(void);
-unsigned split_args(char *args, char *** const argv_ptr, const char *delim);
+unsigned split_args(char *args, char *** const argv_ptr);
/** \cond LLONG_MAX and LLONG_LIN might not be defined. */