Fixes a bug in option string parsing wherein a line such as:
ro,relatime,,nosuid,nodev
Will be seen as only the tokens "ro" and "relatime" after the parser
encounters a zero length (and erroneously declared NULL) option.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
if (valsz)
*valsz = 0;
+ /* trim leading commas as to not invalidate option
+ * strings with multiple consecutive commas */
+ while (optstr0 && *optstr0 == ',')
+ optstr0++;
+
for (p = optstr0; p && *p; p++) {
if (!start)
start = p; /* begin of the option item */