aboutsummaryrefslogtreecommitdiffstats
path: root/camel/gmime-content-field.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>2000-02-10 04:35:35 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-02-10 04:35:35 +0800
commit3bd58106efb22b78e6fbabe9307880338ae92746 (patch)
tree6f54c6597f461a01d0750232d3c0f1ca423389a1 /camel/gmime-content-field.c
parent4c87a79aa40f9fccc40f036b8e182122914cadb0 (diff)
downloadgsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.tar
gsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.tar.gz
gsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.tar.bz2
gsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.tar.lz
gsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.tar.xz
gsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.tar.zst
gsoc2013-evolution-3bd58106efb22b78e6fbabe9307880338ae92746.zip
various typo fixes in the ctree construction.
2000-02-09 bertrand <Bertrand.Guiheneuf@aful.org> * tests/ui-tests/message-browser.c: various typo fixes in the ctree construction. * camel/string-utils.c (string_trim): fix braindead trailing trim bug. * camel/gmime-content-field.c (gmime_content_field_construct_from_string): strip the leading and trailing quotes when constructing the content field. This should be done in a more generic RFC822 approach, but this fixes a bug that prevent matt from analysing some multipart messages. * camel/camel-data-wrapper.h: reorganize the deprecated and new methods. * camel/providers/mbox/camel-mbox-folder.c (_check_get_or_maybe_generate_summary_file): Use "From " as the message separating string. * camel/providers/mbox/camel-mbox-folder.c (_append_message): set the mode when creating the mbox file. * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): ditto * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary): ditto svn path=/trunk/; revision=1711
Diffstat (limited to 'camel/gmime-content-field.c')
-rw-r--r--camel/gmime-content-field.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/camel/gmime-content-field.c b/camel/gmime-content-field.c
index 0a72246a0d..3c1f4fbc7b 100644
--- a/camel/gmime-content-field.c
+++ b/camel/gmime-content-field.c
@@ -309,21 +309,30 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, con
first = 0;
len = strlen (string);
- if (!len) return;
+ if (!len) {
+ CAMEL_LOG_FULL_DEBUG ( "GMimeContentField::construct_from_string, leaving\n");
+ return;
+ }
CAMEL_LOG_FULL_DEBUG ("GMimeContentField::construct_from_string, All checks done\n");
-
+ CAMEL_LOG_FULL_DEBUG ("GMimeContentField::construct_from_string the complete header is\n"
+ "-------------------\n%s\n-------------------\n", string);
/* find the type */
while ( (i<len) && (!strchr ("/;", string[i])) ) i++;
- if (i == 0) return;
+ if (i == 0) {
+ CAMEL_LOG_FULL_DEBUG ( "GMimeContentField::construct_from_string, leaving\n");
+ return;
+ }
type = g_strndup (string, i);
- string_trim (type, " \t", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
+ string_trim (type, " \t\"", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
content_field->type = type;
CAMEL_LOG_TRACE ( "GMimeContentField::construct_from_string, Found mime type : \"%s\"\n", type);
if (i >= len-1) {
content_field->subtype = NULL;
- return;
+
+ CAMEL_LOG_FULL_DEBUG ( "GMimeContentField::construct_from_string only found the type leaving\n");
+ return;
}
first = i+1;
@@ -332,10 +341,13 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, con
while ( (i<len) && (string[i] != ';') ) i++;
if (i != first) {
subtype = g_strndup (string+first, i-first);
- string_trim (subtype, " \t", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
+ string_trim (subtype, " \t\"", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
content_field->subtype = subtype;
CAMEL_LOG_TRACE ( "GMimeContentField::construct_from_string, Found mime subtype: \"%s\"\n", subtype);
- if (i >= len-1) return;
+ if (i >= len-1) {
+ CAMEL_LOG_FULL_DEBUG ( "GMimeContentField::construct_from_string found the subtype but no parameter, leaving\n");
+ return;
+ }
}
}
first = i+1;
@@ -348,7 +360,7 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, con
else {
/* we have found parameter name */
param_name = g_strndup (string+first, i-first);
- string_trim (param_name, " ", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
+ string_trim (param_name, " \"", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
i++;
first = i;
/* Let's find parameter value */
@@ -356,7 +368,7 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, con
if (i != first) param_value = g_strndup (string+first, i-first);
else param_value = g_strdup ("");
CAMEL_LOG_TRACE ( "GMimeContentField::construct_from_string, Found mime parameter \"%s\"=\"%s\"\n", param_name, param_value);
- string_trim (param_value, " \t", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
+ string_trim (param_value, " \t\"", STRING_TRIM_STRIP_TRAILING | STRING_TRIM_STRIP_LEADING);
gmime_content_field_set_parameter (content_field, param_name, param_value);
g_free (param_name);
g_free (param_value);