[gmime/gmime-2-4] Handle non-standard Content-Transfer-Encodings names
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime/gmime-2-4] Handle non-standard Content-Transfer-Encodings names
- Date: Wed, 24 Oct 2012 03:23:14 +0000 (UTC)
commit da92f3eee6cc5aaeacf34963994f811edab550b8
Author: Jeffrey Stedfast <fejj gnome org>
Date: Sun Feb 19 19:54:58 2012 -0500
Handle non-standard Content-Transfer-Encodings names
2012-02-19 Jeffrey Stedfast <fejj gnome org>
* gmime/gmime-encodings.c (g_mime_content_encoding_from_string):
Match non-standard encodings: 7-bit, 8-bit, and x-uue (the
standard names for these are 7bit, 8bit, and x-uuencode).
ChangeLog | 6 ++++++
gmime/gmime-encodings.c | 8 +++++++-
2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 37f1022..99ea655 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2012-02-19 Jeffrey Stedfast <fejj gnome org>
+ * gmime/gmime-encodings.c (g_mime_content_encoding_from_string):
+ Match non-standard encodings: 7-bit, 8-bit, and x-uue (the
+ standard names for these are 7bit, 8bit, and x-uuencode).
+
+2012-02-19 Jeffrey Stedfast <fejj gnome org>
+
* gmime/gmime-common.c (g_mime_strdup_trim): New function that
optimizes g_strstrip combined with g_strdup in both speed and
memory usage (g_strstrip won't shrink the size of the dup'd
diff --git a/gmime/gmime-encodings.c b/gmime/gmime-encodings.c
index c06a2c6..555676d 100644
--- a/gmime/gmime-encodings.c
+++ b/gmime/gmime-encodings.c
@@ -102,7 +102,7 @@ static unsigned char tohex[16] = {
/**
* g_mime_content_encoding_from_string:
- * @str: string representing a Content-Transfer-Encoding value
+ * @str: a string representing a Content-Transfer-Encoding value
*
* Gets the appropriate #GMimeContentEncoding enumeration value based
* on the input string.
@@ -117,6 +117,10 @@ g_mime_content_encoding_from_string (const char *str)
return GMIME_CONTENT_ENCODING_7BIT;
else if (!g_ascii_strcasecmp (str, "8bit"))
return GMIME_CONTENT_ENCODING_8BIT;
+ else if (!g_ascii_strcasecmp (str, "7-bit"))
+ return GMIME_CONTENT_ENCODING_7BIT;
+ else if (!g_ascii_strcasecmp (str, "8-bit"))
+ return GMIME_CONTENT_ENCODING_8BIT;
else if (!g_ascii_strcasecmp (str, "binary"))
return GMIME_CONTENT_ENCODING_BINARY;
else if (!g_ascii_strcasecmp (str, "base64"))
@@ -127,6 +131,8 @@ g_mime_content_encoding_from_string (const char *str)
return GMIME_CONTENT_ENCODING_UUENCODE;
else if (!g_ascii_strcasecmp (str, "x-uuencode"))
return GMIME_CONTENT_ENCODING_UUENCODE;
+ else if (!g_ascii_strcasecmp (str, "x-uue"))
+ return GMIME_CONTENT_ENCODING_UUENCODE;
else
return GMIME_CONTENT_ENCODING_DEFAULT;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]