RFR-8008118
Martin Buchholz
martinrb at google.com
Fri Mar 29 00:07:53 UTC 2013
strsep is nice, but not standard enough to use in the JDK.
OTOH, strcspn is already used in the JDK, but doesn't really buy much:
for (i = 0; i < count; i++) {
int len = strcspn(p, ":");
pathv[i] = (len == 0) ? "." : p;
p[len] = '\0';
p += len + 1;
}
On Thu, Mar 28, 2013 at 12:10 PM, Christos Zoulas <christos at zoulas.com>wrote:
>
> + for (i = 0; (pathv[i] = strsep(&p, ":")) != NULL; i++)
> + if (!pathv[i][0])
> + pathv[i] = ".";
>
> christos
>
More information about the core-libs-dev
mailing list