This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 08/10] Fix infinite recursion in grammar for depends
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Tue, 23 May 2017 17:59:09 +0100
- Subject: [PATCH setup 08/10] Fix infinite recursion in grammar for depends
- Authentication-results: sourceware.org; auth=none
- References: <20170523164558.50320-1-jon.turney@dronecode.org.uk>
Allowing listseparator to be empty allows an infinite recursion in the
versionedpackagelist rule
Also make the comment documenting versionedpackageentry is non-empty
consistent with all other similar comments
Also allow lower-case depends:
---
inilex.ll | 2 +-
iniparse.yy | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/inilex.ll b/inilex.ll
index 798a04b..b454f0f 100644
--- a/inilex.ll
+++ b/inilex.ll
@@ -121,7 +121,7 @@ B64 [a-zA-Z0-9_-]
"category:"|"Section:" return CATEGORY;
"requires:" return REQUIRES;
-"Depends:" return DEPENDS;
+[dD]"epends:" return DEPENDS;
^{STR}":" ignore_line ();
diff --git a/iniparse.yy b/iniparse.yy
index d768400..8ee7dc3 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -132,12 +132,12 @@ versionedpackagelistsp /* non-empty */
| versionedpackagelistsp versionedpackageentry
;
-listseparator: /* empty */
- | COMMA
+listseparator /* non-empty */
+ : COMMA
| COMMA NL
;
-versionedpackageentry /* empty not allowed */
+versionedpackageentry /* non-empty */
: STRING { iniBuilder->buildPackageListNode($1); } versioncriteria
;
--
2.12.3