From 7d31b78414593be0911e7eb5941c3c064a22623c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Sun, 10 Jun 2012 06:28:09 +0200 Subject: [PATCH 1/3] Fix a warning --- src/dvb/dvb_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dvb/dvb_support.c b/src/dvb/dvb_support.c index 9830c2b9..9e8b71e7 100644 --- a/src/dvb/dvb_support.c +++ b/src/dvb/dvb_support.c @@ -41,7 +41,7 @@ static int convert_iso_8859[16] = { #define convert_utf8 14 #define convert_iso6937 15 -static inline int encode_utf8(uint16_t c, char *outb, int outleft) +static inline int encode_utf8(unsigned int c, char *outb, int outleft) { if (c <= 0x7F && outleft >= 1) { *outb = c; From bccec4322215d1fcff58616e8db4dd6a1ebfa1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Mon, 11 Jun 2012 14:41:08 +0200 Subject: [PATCH 2/3] deb: Rename tvheadend.tvheadend.init -> tvheadend.init --- debian/{tvheadend.tvheadend.init => tvheadend.init} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename debian/{tvheadend.tvheadend.init => tvheadend.init} (100%) diff --git a/debian/tvheadend.tvheadend.init b/debian/tvheadend.init similarity index 100% rename from debian/tvheadend.tvheadend.init rename to debian/tvheadend.init From 11944f0933463e538f0479118952ad3493c0255f Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 15 Jun 2012 11:40:01 +0100 Subject: [PATCH 3/3] Fix json parsing to handle empty objects and ensure hm_ilist is properly set on htsmsg_add_msg to allow some post load modifications. --- src/htsmsg.c | 2 ++ src/htsmsg_json.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/htsmsg.c b/src/htsmsg.c index c74a3afc..6de14e4e 100644 --- a/src/htsmsg.c +++ b/src/htsmsg.c @@ -258,6 +258,7 @@ htsmsg_add_msg(htsmsg_t *msg, const char *name, htsmsg_t *sub) assert(sub->hm_data == NULL); TAILQ_MOVE(&f->hmf_msg.hm_fields, &sub->hm_fields, hmf_link); + f->hmf_msg.hm_islist = sub->hm_islist; free(sub); } @@ -275,6 +276,7 @@ htsmsg_add_msg_extname(htsmsg_t *msg, const char *name, htsmsg_t *sub) assert(sub->hm_data == NULL); TAILQ_MOVE(&f->hmf_msg.hm_fields, &sub->hm_fields, hmf_link); + f->hmf_msg.hm_islist = sub->hm_islist; free(sub); } diff --git a/src/htsmsg_json.c b/src/htsmsg_json.c index 88cd0e31..a302247d 100644 --- a/src/htsmsg_json.c +++ b/src/htsmsg_json.c @@ -233,7 +233,10 @@ htsmsg_json_parse_object(const char *s, const char **endp) r = htsmsg_create_map(); - while(1) { + while(*s > 0 && *s < 33) + s++; + + if(*s != '}') while(1) { if((name = htsmsg_json_parse_string(s, &s2)) == NULL) { htsmsg_destroy(r);