Date: Mon, 15 Dec 2003 14:20:41 -0500
From: Carl Mummert <mummert(_at_)math(_dot_)psu(_dot_)edu>
Message-ID:
<21953(_dot_)1071516041(_at_)hasse(_dot_)math(_dot_)psu(_dot_)edu>
| I coded an mh-format function "unquote" to
| remove balanced single and double quotes (a slight generalization of
| quoted-string)
A generalisation yes, but an incorrect one - single quotes are not
special in 822, and don't want to be, things like O'Toole are perfectly
valid names for people to have. What's more, a name field may have
two people with ' characters in their names (O'Toole & O'Sullivan)
which shouldn't turn into OToole & OSullivan) Only " quotes strings,
' is just a character.
I have a half suspicion that an (incorrect, but still possible) lone \
at the end of the string might break your code too (just from reading it).
The algorithm could probably also be improved, there's no need to find
and remove the closing " in a string, and then go back and process it
all again - just copy to the output buffer while seeking the ". Quoted
strings don't nest (and with just one quoting character, they cannot),
there's no need to allow for that possibility.
kre
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://mail.nongnu.org/mailman/listinfo/nmh-workers