bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module proposal: split


From: Davide Angelocola
Subject: Re: new module proposal: split
Date: Wed, 6 Sep 2006 09:13:44 +0200
User-agent: KMail/1.9.4

On Wednesday 06 September 2006 06:24, you wrote:
> It is not clear, will this split do something like
> like creating an *argv[] list which has a NULL
> pointer as the last element in the array?
exactly

> Hmmm... is argc guarenteed to be positive? If not,
> what does a negative argc mean? If so, would
> 'size_t *' be a better type for argc?
mh size_t* is a better type for argc.

> Does split() ever return NULL? Or, is it like the
> functions that call error () when there are problems?
can split() signals errors returning NULL and setting argc to 0?

> That is, does this code just core dump with the
> NULL dereference:
>
>     int argc;
>     char **foo = split (NULL, '\0', &argc);
>
> or is errno set and/or error() called?
>
>     char **bar = split ("abcd", ' ', &argc);
>
> Have you considered the desirability of multiple break characters?
> Possibly something like strtok_r semantics to
> break a string into a number of argv tokens based
> on a string of possible break characters
> (e.g., " \t\n\r")
no, but this a very nice idea

Best Regards,
-- Davide Angelocola




reply via email to

[Prev in Thread] Current Thread [Next in Thread]