Blob Blame History Raw
autofs-5.1.0 - ignore multiple commas in options strings

From: Ian Kent <ikent@redhat.com>

When parsing options strings (such as opts, addopts or remopts) the parser
would object to multiple occurrances of the comma character. But this is
probably not a significant problem and the parser should just ignore them.
---
 CHANGELOG           |    1 +
 modules/amd_parse.y |    4 ++++
 modules/amd_tok.l   |    4 ++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index fe9b2f9..2b7d55a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -28,6 +28,7 @@
 - fix memory leak in get_defaults_entry().
 - fix out of order clearing of options buffer.
 - fix reset amd lexer scan buffer.
+- ignore multiple commas in options strings.
 
 04/06/2014 autofs-5.1.0
 =======================
diff --git a/modules/amd_parse.y b/modules/amd_parse.y
index a7f38f8..ce8623d 100644
--- a/modules/amd_parse.y
+++ b/modules/amd_parse.y
@@ -465,6 +465,10 @@ options: OPTION
 	{
 		prepend_opt(opts, $1);
 	}
+	| OPTION COMMA
+	{
+		prepend_opt(opts, $1);
+	}
 	;
 
 %%
diff --git a/modules/amd_tok.l b/modules/amd_tok.l
index 36bce49..03e716f 100644
--- a/modules/amd_tok.l
+++ b/modules/amd_tok.l
@@ -284,9 +284,9 @@ CUTSEP		(\|\||\/)
 		return SPACE;
 	}
 
-	":=" { return OPTION_ASSIGN; }
+	(:=)(,+)? { return OPTION_ASSIGN; }
 
-	"," { return COMMA; }
+	,+ { return COMMA; }
 
 	{OPTS} {
 		amd_copy_buffer();