aboutsummaryrefslogtreecommitdiffstats
path: root/camel/gmime-utils.c
diff options
context:
space:
mode:
authorBertrand Guiheneuf <bertrand@src.gnome.org>1999-05-30 19:40:05 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-05-30 19:40:05 +0800
commit1d01c8dad13eeab68241617b0ca981a8582b8215 (patch)
treecbbdff38dc5bdf46f914b51d5849bd440aa45ecc /camel/gmime-utils.c
parenta5cd99a2635e4d199ba06e94c01d628e35573a35 (diff)
downloadgsoc2013-evolution-1d01c8dad13eeab68241617b0ca981a8582b8215.tar.gz
gsoc2013-evolution-1d01c8dad13eeab68241617b0ca981a8582b8215.tar.zst
gsoc2013-evolution-1d01c8dad13eeab68241617b0ca981a8582b8215.zip
remove leading and trailing spaces in recipient addresses.
* camel/camel-mime-message.c (_set_recipient_list_from_string): remove leading and trailing spaces in recipient addresses. * camel/gmime-utils.c (_store_header_pair_from_gstring): remove leading and trailing spaces from header values. * camel/gstring-util.c (g_string_trim): new func: remove leading or trailng chars from a specified char set. (g_string_split): allow trimming of substrings. * tests/test1.c (main): remove gtk_main call svn path=/trunk/; revision=958
Diffstat (limited to 'camel/gmime-utils.c')
-rw-r--r--camel/gmime-utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/camel/gmime-utils.c b/camel/gmime-utils.c
index 9f489a257a..92d04d5bf8 100644
--- a/camel/gmime-utils.c
+++ b/camel/gmime-utils.c
@@ -99,14 +99,16 @@ _store_header_pair_from_gstring (GHashTable *header_table, GString *header_line)
g_assert (header_table);
if ( (header_line) && (header_line->str) ) {
- dich_result = g_string_dichotomy(header_line, ':', &header_name, &header_value, NONE);
+ dich_result = g_string_dichotomy(header_line, ':', &header_name, &header_value, DICHOTOMY_NONE);
if (dich_result != 'o')
camel_log(WARNING,
"store_header_pair_from_gstring : dichotomy result is %c"
"header line is :\n--\n%s\n--\n");
- else
+ else {
+ g_string_trim (header_value, " \t", TRIM_STRIP_LEADING | TRIM_STRIP_TRAILING);
g_hash_table_insert (header_table, header_name, header_value);
+ }
}
}
@@ -159,7 +161,6 @@ get_header_table_from_file (FILE *file)
if (!end_of_header_line) next_char = fgetc (file);
} while ( !end_of_header_line );
-
if ( strlen(header_line->str) )
_store_header_pair_from_gstring (header_table, header_line);
g_string_free (header_line, FALSE);