aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2022-03-13 18:12:26 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2022-03-19 20:21:09 -0400
commitec38714bbc81c765990bcab2f6c3772e54eb2c75 (patch)
tree725fffb17fdc824475762d9f4097d10eb48295b6
parent01ad848628b91461a831e5725c6e416bae76b930 (diff)
downloadcalcurse-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.c9
-rwxr-xr-xtest/ical-009.sh3
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 <<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.