I have taken some time to investigate this issue and the problem is that you use the "isalpha" function in the is_mime_char routine:

#define is_mime_char(_c_) \
        (isalpha((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.' || (_c_)=='_')

But a MIME type can have digits in it (as you can see in some MIME types registered with IANA: http://www.iana.org/assignments/media-types/media-types.xhtml)

So a more convenient validation function would be "isalnum":

#define is_mime_char(_c_) \
        (isalnum((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.' || (_c_)=='_')

After changing this, there is no more parsing errors.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub