]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
HTSP: allow to remove language settings
authorJaroslav Kysela <perex@perex.cz>
Fri, 29 May 2015 16:39:43 +0000 (18:39 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 29 May 2015 18:52:45 +0000 (20:52 +0200)
src/htsp_server.c

index 82d8b4f7d9ec760ddf4332063231e8ce3d15a2e4..4e63a0b474e1c4f45c12fba16bca96c87e25f480 100644 (file)
@@ -1066,8 +1066,14 @@ htsp_method_async(htsp_connection_t *htsp, htsmsg_t *in)
   htsmsg_get_u32(in, "epg", &epg);
   htsmsg_get_s64(in, "lastUpdate", &lastUpdate);
   htsmsg_get_s64(in, "epgMaxTime", &epgMaxTime);
-  if ((lang = htsmsg_get_str(in, "language")))
-    htsp->htsp_language = strdup(lang);
+  if ((lang = htsmsg_get_str(in, "language")) != NULL) {
+    if (lang[0]) {
+      htsp->htsp_language = strdup(lang);
+    } else {
+      free(htsp->htsp_language);
+      htsp->htsp_language = NULL;
+    }
+  }
 
   /* First, just OK the async request */
   htsp_reply(htsp, in, htsmsg_create_map());