ical.c: Remove newlines from item summaries
Newline characters are not allowed in calcurse item descriptions. Replace any newlines in iCal summary lines with spaces. Fixes GitHub issue #6. Reported-by: Jonathan McCrohan <jmccrohan@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
82aa3e3f43
commit
936d5f139f
18
src/ical.c
18
src/ical.c
@ -843,13 +843,19 @@ static char *ical_read_summary(char *line)
|
||||
{
|
||||
char *p, *summary;
|
||||
|
||||
if ((p = strchr(line, ':')) != NULL) {
|
||||
p++;
|
||||
summary = ical_unformat_line(p);
|
||||
return summary;
|
||||
} else {
|
||||
p = strchr(line, ':');
|
||||
if (!p)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
summary = ical_unformat_line(p + 1);
|
||||
if (!summary)
|
||||
return NULL;
|
||||
|
||||
/* Event summaries must not contain newlines. */
|
||||
for (p = strchr(summary, '\n'); p; p = strchr(p, '\n'))
|
||||
*p = ' ';
|
||||
|
||||
return summary;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user