summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-12-25 23:48:35 -0500
committerDmitri Pal <dpal@redhat.com>2011-01-03 15:00:42 -0500
commite5a6bb7e8fab4b7e23f31ee1ab5ce10bf7dd33d5 (patch)
treee51299d2dd733903275f0e91e3cfefbabe57bf20
parent27cf7bc5c1089380cc7bc893deee8eb88db2d3d4 (diff)
downloadding-libs-e5a6bb7e8fab4b7e23f31ee1ab5ce10bf7dd33d5.tar.gz
ding-libs-e5a6bb7e8fab4b7e23f31ee1ab5ce10bf7dd33d5.tar.xz
ding-libs-e5a6bb7e8fab4b7e23f31ee1ab5ce10bf7dd33d5.zip
[INI] Change parse_error to use save_error
* Changed parse_error to use save_error function created in previous commit. * Fixed comment to be more clear.
-rw-r--r--ini/ini_parse.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ini/ini_parse.c b/ini/ini_parse.c
index a2e05f9..e7eab28 100644
--- a/ini/ini_parse.c
+++ b/ini/ini_parse.c
@@ -981,19 +981,17 @@ static int parser_error(struct parser_obj *po)
int error = EOK;
uint32_t action;
int idx = 0;
- const char *errtxt[] = { ERROR_TXT, WARNING_TXT };
- struct ini_parse_error pe;
TRACE_FLOW_ENTRY();
- pe.line = po->linenum;
- /* Clear the warning bit */
- pe.error = po->last_error & ~INI_WARNING;
if (po->last_error & INI_WARNING) idx = 1;
- error = col_add_binary_property(po->el, NULL,
- errtxt[idx], &pe, sizeof(pe));
+
+ error = save_error(po->el,
+ po->linenum,
+ po->last_error & ~INI_WARNING,
+ idx);
if (error) {
- TRACE_ERROR_NUMBER("Failed to add error to collection",
+ TRACE_ERROR_NUMBER("Failed to add error to error list",
error);
return error;
}
@@ -1043,7 +1041,9 @@ static int parser_error(struct parser_obj *po)
/* If merging sections should produce error and we got error
* or if we merge sections but dup values produce error and
* we got error then it is not a fatal error so we need to handle
- * it nicely. We check for reverse condition and return error,
+ * it nicely and suppress it here. We already in the procees
+ * of handling another error and merge error does not matter here.
+ * We check for reverse condition and return error,
* otherwise fall through.
*/
if (!((((po->collision_flags & INI_MS_MASK) == INI_MS_ERROR) &&