jstedfast / gmime

A C/C++ MIME creation and parser library with support for S/MIME, PGP, and Unix mbox spools.
GNU Lesser General Public License v2.1
113 stars 36 forks source link

Fix g_mime_content_encoding_to_string return null for …DEFAULT value #94

Closed mjog closed 4 years ago

mjog commented 4 years ago

Its API docs say that GMIME_CONTENT_ENCODING_DEFAULT is a valid value, but that is missed in the switch, resulting in null being returned when that is passed in.

This also fixes expected behaviour for the Vala bindings, where a string is returned for any valid enum value.

jstedfast commented 4 years ago

So the way this is meant to be handled is if NULL is returned, you just don't add a Content-Transfer-Encoding header. Otherwise the value returned should be set as the value. A value of "default" isn't helpful because there is no such encoding and no code in the wild exists that will check for it.