diff options
| -rw-r--r-- | src/xplist.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/xplist.c b/src/xplist.c index 3971622..9569d07 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -955,7 +955,6 @@ static char* text_parts_get_content(text_part_t *tp, int unesc_entities, size_t | |||
| 955 | 955 | ||
| 956 | static int node_from_xml(parse_ctx ctx, plist_t *plist) | 956 | static int node_from_xml(parse_ctx ctx, plist_t *plist) |
| 957 | { | 957 | { |
| 958 | int res; | ||
| 959 | char *tag = NULL; | 958 | char *tag = NULL; |
| 960 | char *keyname = NULL; | 959 | char *keyname = NULL; |
| 961 | plist_t subnode = NULL; | 960 | plist_t subnode = NULL; |
| @@ -1449,11 +1448,21 @@ err_out: | |||
| 1449 | if (ctx->err) { | 1448 | if (ctx->err) { |
| 1450 | plist_free(*plist); | 1449 | plist_free(*plist); |
| 1451 | *plist = NULL; | 1450 | *plist = NULL; |
| 1452 | res = PLIST_ERR_PARSE; | 1451 | return PLIST_ERR_PARSE; |
| 1453 | } else { | ||
| 1454 | res = PLIST_ERR_SUCCESS; | ||
| 1455 | } | 1452 | } |
| 1456 | return res; | 1453 | |
| 1454 | /* check if we have a UID "dict" so we can replace it with a proper UID node */ | ||
| 1455 | if (PLIST_IS_DICT(*plist) && plist_dict_get_size(*plist) == 1) { | ||
| 1456 | plist_t value = plist_dict_get_item(*plist, "CF$UID"); | ||
| 1457 | if (PLIST_IS_UINT(value)) { | ||
| 1458 | uint64_t u64val = 0; | ||
| 1459 | plist_get_uint_val(value, &u64val); | ||
| 1460 | plist_free(*plist); | ||
| 1461 | *plist = plist_new_uid(u64val); | ||
| 1462 | } | ||
| 1463 | } | ||
| 1464 | |||
| 1465 | return PLIST_ERR_SUCCESS; | ||
| 1457 | } | 1466 | } |
| 1458 | 1467 | ||
| 1459 | PLIST_API plist_err_t plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) | 1468 | PLIST_API plist_err_t plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) |
