diff options
author | Dmitri Pal <dpal@redhat.com> | 2010-12-26 00:10:23 -0500 |
---|---|---|
committer | Dmitri Pal <dpal@redhat.com> | 2011-01-03 15:00:43 -0500 |
commit | 8fb3799dc674770bb622b630267a7a436449069e (patch) | |
tree | 167efb8b037c960a21b4351b217133ca4338db5d | |
parent | 6d4b2785106cd6614eedb62069da76ecc2e90457 (diff) | |
download | ding-libs-8fb3799dc674770bb622b630267a7a436449069e.tar.gz ding-libs-8fb3799dc674770bb622b630267a7a436449069e.tar.xz ding-libs-8fb3799dc674770bb622b630267a7a436449069e.zip |
[INI] Return error in DETECT mode
If in merge DETECT mode and there were no parsing errors
return error if there were merge collisions.
-rw-r--r-- | ini/ini_parse.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ini/ini_parse.c b/ini/ini_parse.c index d9c6d0a..3f45ac7 100644 --- a/ini/ini_parse.c +++ b/ini/ini_parse.c @@ -1441,7 +1441,18 @@ int parser_run(struct parser_obj *po) col_delete_item(item); if (action == PARSE_DONE) { + TRACE_INFO_NUMBER("We are done", error); + + /* Report merge error in detect mode + * if no other error was detected. */ + if ((po->ret == 0) && + (po->merge_error != 0) && + ((po->collision_flags & INI_MV1S_DETECT) || + (po->collision_flags & INI_MV2S_DETECT) || + (po->collision_flags & INI_MS_DETECT))) + po->ret = po->merge_error; + error = po->ret; break; } |