From: Christoph Hohmann Date: Wed, 17 Oct 2001 18:52:35 +0000 (+0000) Subject: ignore empty or whitespace only header lines X-Git-Tag: Release_0_6_4claws12~35 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=7af3db37b787fdfbc68231457664b44468f451b2 ignore empty or whitespace only header lines --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 0762203f8..2de297873 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2001-10-17 [christoph] 0.6.3claws21 + + * src/compose.c + ignore empty or whitespace only header lines + 2001-10-17 [paul] 0.6.3claws20 * sync with sylpheed 0.6.3cvs7 diff --git a/configure.in b/configure.in index f1bbb2da6..0c70d5715 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=6 MICRO_VERSION=3 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws20 +EXTRA_VERSION=claws21 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl diff --git a/src/compose.c b/src/compose.c index 0ba52c5b9..b5a085961 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2550,14 +2550,16 @@ gboolean compose_check_for_valid_recipient(Compose *compose) { gchar *header; gchar *entry; header = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(((compose_headerentry *)list->data)->combo)->entry)); - entry = gtk_entry_get_text(GTK_ENTRY(((compose_headerentry *)list->data)->entry)); - if(strlen(entry)) { + entry = gtk_editable_get_chars(GTK_EDITABLE(((compose_headerentry *)list->data)->entry), 0, -1); + g_strstrip(entry); + if(entry[0] != '\0') { for(strptr = recipient_headers; *strptr != NULL; strptr++) { if(!strcmp(header, (prefs_common.trans_hdr ? gettext(*strptr) : *strptr))) { recipient_found = TRUE; } } } + g_free(entry); } return recipient_found; } @@ -3141,18 +3143,20 @@ static gint compose_write_headers_from_headerlist(Compose *compose, str = gtk_entry_get_text(GTK_ENTRY(headerentry->entry)); Xstrdup_a(str, str, return -1); g_strstrip(str); - if(list_append_func) - *dest_list = list_append_func(*dest_list, str); - compose_convert_header - (buf, sizeof(buf), str, - strlen(header) + 2); - if(first_address) { - fprintf(fp, "%s: ", header); - first_address = FALSE; - } else { - fprintf(fp, ", "); + if(str[0] != '\0') { + if(list_append_func) + *dest_list = list_append_func(*dest_list, str); + compose_convert_header + (buf, sizeof(buf), str, + strlen(header) + 2); + if(first_address) { + fprintf(fp, "%s: ", header); + first_address = FALSE; + } else { + fprintf(fp, ", "); + } + fprintf(fp, "%s", buf); } - fprintf(fp, "%s", buf); } } if(!first_address) {