[Freeassociation-devel] Allowing whitespace as the first character of value

crass at berlios.de crass at berlios.de
Tue Mar 30 12:19:40 PDT 2010


Currently libical will parse the property "COMMENT: This is a note" as
the property COMMENT having the text value "This is a note".  According
to rfc2445, whitespace is allowed as the first character of the value
string (see grammar rules in section 4.1).  So the value for the
COMMENT should be " This is a note".

I've attached a patch which fixes this.  It looks like removing the
leading whitespace was implemented in r768 by dothebart when merging
changes from evolutions branch.  Also, it appears that this was
introduced to make parsing more tolerant.  For instance, the property
"DTSTART: 19700328T230000", is not valid under rfc2445, but we allow it
(and probably should).

My patch modifies the parser to not remove leading whitespace from
properties with default value types of TEXT, STRING, and X.  I'm not
sure about STRING because I'm not entirely clear on what it represents
(It seems like its the same as TEXT but literal, not dequoted).

Does anyone have any objections to this patch being committed?

Glenn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: allow_whitespace_at_beginning_of_value.patch
Type: text/x-patch
Size: 2863 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libical-devel/attachments/20100330/0d59f912/attachment.bin>


More information about the libical-devel mailing list