[Libguestfs] [PATCH] builder: allow more empty lines in index files

Pino Toscano ptoscano at redhat.com
Tue Jan 21 16:18:28 UTC 2014


Improve the index grammar tp allow more than one empty line between
sections, and to allow any number of empty lines at the end of the file
(after the last section).
---
 builder/index-parse.y | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/builder/index-parse.y b/builder/index-parse.y
index f5e551b..a8d2f62 100644
--- a/builder/index-parse.y
+++ b/builder/index-parse.y
@@ -80,10 +80,10 @@ index:
         { parsed_index = $2; }
 
 sections:
-      section
+      section emptylines
         { $$ = $1; }
-    | section EMPTY_LINE sections
-        { $$ = $1; $$->next = $3; }
+    | section EMPTY_LINE emptylines sections
+        { $$ = $1; $$->next = $4; }
 
 section:
       SECTION_HEADER fields
@@ -113,6 +113,12 @@ continuations:
           free ($1);
           free ($2); }
 
+emptylines:
+      /* empty */
+        {}
+    | EMPTY_LINE emptylines
+        {}
+
 %%
 
 void
-- 
1.8.3.1




More information about the Libguestfs mailing list