X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=filter.c;h=9a18975faff485c6bdf25fe9cb67a7da746839a1;hb=5d50b3ba7f2e35013e2236219b11fcf75a058770;hp=7dcfa329c42392141090b77c9d3928d578affe4f;hpb=2f873d3d332a64b9c4087e5fccc8d32bf51b4a05;p=pkg%2Fabook.git diff --git a/filter.c b/filter.c index 7dcfa32..9a18975 100644 --- a/filter.c +++ b/filter.c @@ -490,7 +490,7 @@ ldif_read_line(FILE *in) } if(*line != ' ') { - fseek(in, pos, SEEK_SET); + fseek(in, pos, SEEK_SET); /* fixme ! */ free(line); break; } @@ -657,14 +657,38 @@ mutt_read_line(FILE *in, char **alias, char **rest) return 0; } +static void +mutt_fix_quoting(char *p) +{ + char *escape = 0; + + for(; *p; p++) { + switch(*p) { + case '\"': + if(escape) + *escape = ' '; + break; + case '\\': + escape = p; + break; + default: + escape = 0; + } + } +} + static void mutt_parse_email(list_item item) { char *line = item[NAME]; - char *start = line, *tmp; + char *tmp; char *name, *email; +#if 0 + char *start = line; int i = 0; +#endif + mutt_fix_quoting(line); tmp = strconcat("From: ", line, NULL); getname(tmp, &name, &email); free(tmp); @@ -678,6 +702,10 @@ mutt_parse_email(list_item item) else return; + /* + * this is completely broken + */ +#if 0 while( (start = strchr(start, ',')) && i++ < MAX_EMAILS - 1) { tmp = strconcat("From: ", ++start, NULL); getname(tmp, &name, &email); @@ -693,6 +721,7 @@ mutt_parse_email(list_item item) } } } +#endif } static int @@ -913,7 +942,8 @@ pine_parse_buf(char *buf) && pine_conv_table[i] >= 0) { strncpy(tmp, start, len); tmp[len] = 0; - item[pine_conv_table[i]] = strdup(tmp); + if(*tmp) + item[pine_conv_table[i]] = strdup(tmp); } start = end + 1; } @@ -1512,7 +1542,7 @@ text_export_database(FILE * out, struct db_enumerator e) fprintf(out, "-----------------------------------------\n\n"); fprintf(out, "%s", database[e.item][NAME]); - if (database[e.item][NICK]) + if (database[e.item][NICK] && *database[e.item][NICK]) fprintf(out, "\n(%s)", database[e.item][NICK]); fprintf(out, "\n");