char *this_char, *value;
this_char = NULL;
- if ( options )
- this_char = strtok(options,",");
- for ( ; this_char; this_char = strtok(NULL,",")) {
+ while ((this_char = strsep(&options, ",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr(this_char,'=')) != NULL)
*value++ = 0;
if (!strcmp(this_char,"uid")) {
if (!options)
return 1;
- for (this_char = strtok (options, ",");
- this_char != NULL;
- this_char = strtok (NULL, ",")) {
+ while ((this_char = strsep (&options, ",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr (this_char, '=')) != NULL)
*value++ = 0;
if (!strcmp (this_char, "bsddf"))
if (!options)
return 1;
- for (this_char = strtok (options, ",");
- this_char != NULL;
- this_char = strtok (NULL, ",")) {
+ while ((this_char = strsep (&options, ",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr (this_char, '=')) != NULL)
*value++ = 0;
if (!strcmp (this_char, "bsddf"))
goto out;
save = 0;
savep = NULL;
- for (this_char = strtok(options,","); this_char;
- this_char = strtok(NULL,",")) {
+ while ((this_char = strsep(&options,",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr(this_char,'=')) != NULL) {
save = *value;
savep = value;
store_opt(prestodev, NULL, PRESTO_PSDEV_NAME "0");
CDEBUG(D_SUPER, "parsing options\n");
- for (this_char = strtok (options, ",");
- this_char != NULL;
- this_char = strtok (NULL, ",")) {
+ while ((this_char = strsep (&options, ",")) != NULL) {
char *opt;
CDEBUG(D_SUPER, "this_char %s\n", this_char);
+ if (!*this_char)
+ continue;
if ( (opt = read_opt("fileset", this_char)) ) {
store_opt(fileset, opt, NULL);
continue;
if ((options = strchr(name, ','))) {
*options++ = 0;
- cp = strtok(options, ",");
- while (cp) {
+ while ((cp = strsep(&options, ",")) != NULL) {
+ if (!*cp)
+ continue;
if ((val = strchr(cp, '='))) {
struct nfs_int_opts *opts = root_int_opts;
*val++ = '\0';
nfs_data.flags |= opts->or_mask;
}
}
- cp = strtok(NULL, ",");
}
}
if (name[0] && strcmp(name, "default")) {
*uid = current->uid;
*gid = current->gid;
- if (!options) return 1;
- for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
+ if (!options)
+ return 1;
+ while ((this_char = strsep(&options,",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr(this_char,'=')) != NULL)
*value++ = 0;
if (!strcmp(this_char,"uid")) {
if (!options)
return 1;
- for (opt = strtok(options, ","); opt; opt = strtok(NULL, ","))
- {
+ while ((opt = strsep(&options, ",") != NULL) {
+ if (!*opt)
+ continue;
/* Make "opt=val" into two strings */
val = strchr(opt, '=');
if (val)
if (!options)
return 1;
-
- for (this_char = strtok (options, ",");
- this_char != NULL;
- this_char = strtok (NULL, ",")) {
-
+
+ while ((this_char = strsep (&options, ",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr (this_char, '=')) != NULL)
*value++ = 0;
if (!strcmp (this_char, "ufstype")) {
save = 0;
savep = NULL;
ret = 1;
- for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
+ while ((this_char = strsep(&options,",")) != NULL) {
+ if (!*this_char)
+ continue;
if ((value = strchr(this_char,'=')) != NULL) {
save = *value;
savep = value;