From 7ab8b93be5a6e1aa91b47d06d5bcd8061e29735e Mon Sep 17 00:00:00 2001
From: Dmitri Pal <dpal@redhat.com>
Date: Sun, 6 Oct 2013 11:31:50 -0400
Subject: [PATCH 2/5] [INI] Extend error set and add parsing error

One more parsing error is now needed.
---
 ini/ini_configobj.h |   11 +++++++----
 ini/ini_print.c     |    4 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ini/ini_configobj.h b/ini/ini_configobj.h
index 1c04d8a..9a4eb58 100644
--- a/ini/ini_configobj.h
+++ b/ini/ini_configobj.h
@@ -175,7 +175,8 @@ enum ERR_PARSE {
     ERR_SPECIAL,      /**< Line contains invalid characters (Error). */
     ERR_TAB,          /**< Line starts with tab when it
                            should not (Error). */
-    ERR_MAXPARSE = ERR_TAB /**< Special value. Size of the error array. */
+    ERR_BADCOMMENT,   /**< End of file while processing comment (Error). */
+    ERR_MAXPARSE = ERR_BADCOMMENT /**< Special value. Size of the error array. */
 };
 
 /**
@@ -332,11 +333,13 @@ enum ERR_PARSE {
  */
 
 /** @brief Suppress multi line value wrapping */
-#define INI_PARSE_NOWRAP    0x0001
+#define INI_PARSE_NOWRAP           0x0001
 /** @brief No spaces are allowed to the left of the key */
-#define INI_PARSE_NOSPACE   0x0002
+#define INI_PARSE_NOSPACE          0x0002
 /** @brief No tabs are allowed to the left of the key */
-#define INI_PARSE_NOTAB     0x0004
+#define INI_PARSE_NOTAB            0x0004
+/** @brief Do not allow C-style comments */
+#define INI_PARSE_NO_C_COMMENTS    0x0008
 
 /**
  * @}
diff --git a/ini/ini_print.c b/ini/ini_print.c
index 1812cd6..4df934c 100644
--- a/ini/ini_print.c
+++ b/ini/ini_print.c
@@ -126,7 +126,9 @@ static const char *parsing_error_str(int parsing_error)
                                 _("Invalid character at the "
                                   "beginning of the line."),
                                 _("Invalid tab character at the "
-                                  "beginning of the line.")
+                                  "beginning of the line."),
+                                _("Incomplete comment at the "
+                                  "end of the file.")
     };
 
     /* Check the range */
-- 
1.7.1

