diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2022-03-13 18:12:26 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2022-03-19 20:21:09 -0400 |
commit | ec38714bbc81c765990bcab2f6c3772e54eb2c75 (patch) | |
tree | 725fffb17fdc824475762d9f4097d10eb48295b6 | |
parent | 01ad848628b91461a831e5725c6e416bae76b930 (diff) | |
download | calcurse-ec38714bbc81c765990bcab2f6c3772e54eb2c75.tar.gz calcurse-ec38714bbc81c765990bcab2f6c3772e54eb2c75.zip |
Allow newlines in SUMMARY by replacing them with blanks
Addresses Github issue #414 (Android calendar allows them).
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r-- | src/ical.c | 9 | ||||
-rwxr-xr-x | test/ical-009.sh | 3 |
2 files changed, 4 insertions, 8 deletions
@@ -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 <<EOD Import process report: 0131 lines read -2 apps / 0 events / 1 todo / 21 skipped +3 apps / 0 events / 1 todo / 20 skipped VEVENT [12]: invalid or malformed event start time. VEVENT [17]: item start date not defined. VEVENT [21]: rrule frequency not supported. @@ -26,7 +26,6 @@ VEVENT [27]: malformed summary line. VTODO [32]: item priority is invalid (must be between 0 and 9). VEVENT [36]: malformed exceptions line. VEVENT [43]: exception date, but no recurrence rule. -VEVENT [49]: line break in summary. VEVENT [54]: malformed description line. VEVENT [60]: malformed description. VTODO [72]: malformed summary. |