}
/* insert 'substr' or '=substr' to @str on position @pos */
-static int insert_substring(char **str, char *pos, const char *substr, char **next)
+static int insert_value(char **str, char *pos, const char *substr, char **next)
{
size_t subsz = strlen(substr); /* substring size */
size_t strsz = strlen(*str);
else if (value && ol.value == NULL)
/* insert "=value" */
- rc = insert_substring(optstr, nameend, value, NULL);
+ rc = insert_value(optstr, nameend, value, NULL);
else if (value && ol.value && strlen(value) == ol.valsz)
/* simply replace =value */
else if (value && ol.value) {
mnt_optstr_remove_option_at(optstr, nameend, ol.end);
- rc = insert_substring(optstr, nameend, value, NULL);
+ rc = insert_value(optstr, nameend, value, NULL);
}
return rc;
}
}
/**
- * mnt_optstr_apply_flags:
+ * mnt_optstr_apply_mountflags:
* @optstr: string with comma separated list of options
* @flags: returns mount flags
* @map: options map
/* set new context */
mnt_optstr_remove_option_at(optstr, begin, end);
- rc = insert_substring(optstr, begin, val, next);
+ rc = insert_value(optstr, begin, val, next);
free(val);
#endif
return rc;
snprintf(buf, sizeof(buf), "%u", num);
mnt_optstr_remove_option_at(optstr, begin, end);
- return insert_substring(optstr, begin, buf, next);
+ return insert_value(optstr, begin, buf, next);
}
/**
/* remove old value */
mnt_optstr_remove_option_at(optstr, value, value + valsz);
- rc = insert_substring(optstr, value, username, next);
+ rc = insert_value(optstr, value, username, next);
}
free(username);