From ec38714bbc81c765990bcab2f6c3772e54eb2c75 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sun, 13 Mar 2022 18:12:26 +0100 Subject: Allow newlines in SUMMARY by replacing them with blanks Addresses Github issue #414 (Android calendar allows them). Signed-off-by: Lukas Fleischer --- src/ical.c | 9 +++------ test/ical-009.sh | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ical.c b/src/ical.c index 64368e3..535bca8 100644 --- a/src/ical.c +++ b/src/ical.c @@ -1331,12 +1331,9 @@ static char *ical_read_summary(char *line, unsigned *noskipped, } /* An event summary is one line only. */ - if (strchr(summary, '\n')) { - ical_log(log, item_type, itemline, _("line break in summary.")); - (*noskipped)++; - mem_free(summary); - summary = NULL; - } + for (p = summary; *p; p++) + if (*p == '\n') + *p = ' '; leave: return summary; } diff --git a/test/ical-009.sh b/test/ical-009.sh index dbd0a30..6c1a0d4 100755 --- a/test/ical-009.sh +++ b/test/ical-009.sh @@ -18,7 +18,7 @@ if [ "$1" = 'actual' ]; then elif [ "$1" = 'expected' ]; then cat <