diff mbox series

[2/3] libdvbv5: enable newlines in dvb strings

Message ID 20190102160314.7451-2-neolynx@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] libdvbv5: do not adjust DVB time daylight saving | expand

Commit Message

André Roth Jan. 2, 2019, 4:03 p.m. UTC
Newlines in are encoded as 0x8a, convert them to '\n'

Signed-off-by: André Roth <neolynx@gmail.com>
---
 lib/libdvbv5/parse_string.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/libdvbv5/parse_string.c b/lib/libdvbv5/parse_string.c
index 6e301ac8..d354f497 100644
--- a/lib/libdvbv5/parse_string.c
+++ b/lib/libdvbv5/parse_string.c
@@ -461,11 +461,13 @@  void dvb_parse_string(struct dvb_v5_fe_parms *parms, char **dest, char **emph,
 				emphasis = 1;
 			else if (*s == 0x87 && emphasis)
 				emphasis = 0;
-			else  if (*s >= 0x20 && (*s < 0x80 || *s > 0x9f)) {
+			else if (*s >= 0x20 && (*s < 0x80 || *s > 0x9f)) {
 				*p++ = *s;
 				if (emphasis)
 					*p2++ = *s;
 			}
+			else if (*s == 0x8a)
+				*p++ = '\n';
 		}
 		*p = '\0';
 		*p2 = '\0';
@@ -495,6 +497,8 @@  void dvb_parse_string(struct dvb_v5_fe_parms *parms, char **dest, char **emph,
 				emphasis = 1;
 			else if (code == 0xe087 && emphasis)
 				emphasis = 0;
+			else if (code == 0xe08a)
+				/* newline, append code blow */ ;
 			else if (code >= 0xe080 && code <= 0xe09f)
 				continue;