NOEXPORT char **arg_alloc(char *str) {
    size_t max_arg, i;
    char **tmp, **retval;

    max_arg=strlen(str)/2+1;
    tmp=str_alloc((max_arg+1)*sizeof(char *));

    i=0;
    while(*str && i<max_arg) {
        tmp[i++]=str;
        while(*str && !isspace((unsigned char)*str))
            ++str;
        while(*str && isspace((unsigned char)*str))
            *str++='\0';
    }
    tmp[i]=NULL; /* null-terminate the table */

    retval=arg_dup(tmp);
    str_free(tmp);
    return retval;
}
NOEXPORT char **arg_alloc(char *str) {
    size_t max_arg, i;
    char **tmp, **retval;

    max_arg=strlen(str)/2+1;
    tmp=str_alloc((max_arg+1)*sizeof(char *));

    i=0;
    while(*str && i<max_arg) {
        tmp[i++]=str;
        while(*str && !isspace((unsigned char)*str))
            ++str;
        while(*str && isspace((unsigned char)*str))
            *str++='\0';
    }
    tmp[i]=NULL;  

    retval=arg_dup(tmp);
    str_free(tmp);
    return retval;
}