X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=filter.c;h=c681af62a84b7d6621fb820a008bf8ff41abe113;hb=978de1f80f0d0ac1dfee83a8f6cb4cb89220e32a;hp=51985f6aeeed2a372918eee576b7cc82d47979f2;hpb=52cba91cb0ff0874934706d13f8bc7b8e04fd32f;p=pkg%2Fabook.git diff --git a/filter.c b/filter.c index 51985f6..c681af6 100644 --- a/filter.c +++ b/filter.c @@ -820,10 +820,14 @@ html_export_database(FILE *out, struct db_enumerator e) db_enumerate_items(e) { get_first_email(tmp, e.item); - fprintf(out, "\n%s\n", - tmp, - database[e.item][NAME] ); - + if (*tmp) + fprintf(out, "\n%s\n", + tmp, + database[e.item][NAME] ); + else + fprintf(out, "\n%s>\n", + database[e.item][NAME] ); + fprintf(out, "%s\n%s\n", database[e.item][EMAIL], safe_str(database[e.item][extra_column]) ); @@ -896,7 +900,7 @@ pine_convert_emails(char *s) *tmp=0; for(i=1; ( tmp = strchr(s, ',') ) != NULL ; i++, s=tmp+1 ) - if( i > 3 ) { + if( i > MAX_EMAILS - 1 ) { *tmp = 0; break; } @@ -950,7 +954,7 @@ pine_parse_file(FILE *in) while(!feof(in)) { for(i=2;;i++) { - buf = realloc(buf, i*LINESIZE); + buf = (char *) realloc(buf, i*LINESIZE); if(i==2) strcpy(buf, line); fgets(line, LINESIZE, in); @@ -962,8 +966,10 @@ pine_parse_file(FILE *in) strcat(buf, ptr); } - if( *buf == '#' ) + if( *buf == '#' ) { + my_free(buf); continue; + } pine_fixbuf(buf); pine_parse_buf(buf);