summaryrefslogtreecommitdiffstats
path: root/libmount/src/optstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r--libmount/src/optstr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index af5953bc6..66d2a06c3 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -62,6 +62,11 @@ static int mnt_optstr_parse_next(char **optstr, char **name, size_t *namesz,
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 */