From: Raphaƫl Droz Date: Thu, 16 Jan 2014 12:51:40 +0000 (+0100) Subject: add-email: fixed a spurious "Valid sender address not found" in interactive-mode X-Git-Tag: upstream/0.6.1~2^2~7 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=5840fceb1f91b066a4c4361b0599c417aa111386;p=pkg%2Fabook.git add-email: fixed a spurious "Valid sender address not found" in interactive-mode when one of several emails addition is refused. Original patch from Daniel Reported-by: Daniel --- diff --git a/abook.c b/abook.c index 1651267..3749561 100644 --- a/abook.c +++ b/abook.c @@ -704,7 +704,7 @@ convert(char *srcformat, char *srcfile, char *dstformat, char *dstfile) * --add-email handling */ -static int add_email_count = 0; +static int add_email_count = 0, add_email_found = 0; static void quit_add_email() @@ -715,7 +715,7 @@ quit_add_email() exit(EXIT_FAILURE); } printf(_("%d item(s) added to %s\n"), add_email_count, datafile); - } else { + } else if (add_email_found == 0) { puts(_("Valid sender address not found")); } @@ -814,6 +814,7 @@ add_email(int quiet) do { line = getaline(stdin); if(line && !strncasecmp("From:", line, 5) ) { + add_email_found++; getname(line, &name, &email); add_email_count += add_email_add_item(quiet, name, email);