iptv pipe: handle the backslash character, fixes#2487

This commit is contained in:
Jaroslav Kysela 2014-11-18 20:44:00 +01:00
parent fa22f18dfc
commit 4f68d03875
2 changed files with 12 additions and 3 deletions

View file

@ -96,7 +96,9 @@
using spaces. A raw MPEG-TS stream is
expected. The string ${service_name}
is substituted with the service name
field contents.
field contents. The \ (backslash) character means
"take the next character asis" (usually
space or the backslash itself.
</dl>

View file

@ -54,8 +54,15 @@ iptv_pipe_start ( iptv_mux_t *im, const char *_raw, const url_t *url )
while (*s && i < ARRAY_SIZE(argv) - 1) {
f = s;
while (*s && *s != ' ')
s++;
while (*s && *s != ' ') {
while (*s && *s != ' ' && *s != '\\')
s++;
if (*s == '\\') {
s++;
if (*s)
s++;
}
}
if (f != s) {
if (*s) {
*(char *)s = '\0';