[mail] Prevent bustling error message when sending mail without attachment
this cosmetic patch removes a false error message from LCR's mail when no attachment is wanted. thanx to bodo for providing this patch!
This commit is contained in:
parent
03f26ba386
commit
d4097e3558
8
mail.c
8
mail.c
|
@ -99,7 +99,8 @@ static void *mail_child(void *arg)
|
||||||
fprintf(ph, "\n * date: %s %d %d %d:%02d\n\n", months[mon], mday, year+1900, hour, min);
|
fprintf(ph, "\n * date: %s %d %d %d:%02d\n\n", months[mon], mday, year+1900, hour, min);
|
||||||
|
|
||||||
/* attach audio file */
|
/* attach audio file */
|
||||||
if ((filename[0]) && ((fh = open(filename, O_RDONLY)))) {
|
if (filename[0]) {
|
||||||
|
if ((fh = open(filename, O_RDONLY))) {
|
||||||
while(strchr(filename, '/'))
|
while(strchr(filename, '/'))
|
||||||
filename = strchr(filename, '/')+1;
|
filename = strchr(filename, '/')+1;
|
||||||
fprintf(ph, "--next_part\n");
|
fprintf(ph, "--next_part\n");
|
||||||
|
@ -144,11 +145,12 @@ static void *mail_child(void *arg)
|
||||||
|
|
||||||
fprintf(ph, "\n\n");
|
fprintf(ph, "\n\n");
|
||||||
close(fh);
|
close(fh);
|
||||||
} else {
|
} else {
|
||||||
SPRINT(buffer, "-Error- Failed to read audio file: '%s'.\n\n", filename);
|
SPRINT(buffer, "-Error- Failed to read audio file: '%s'.\n\n", filename);
|
||||||
fprintf(ph, "%s", buffer);
|
fprintf(ph, "%s", buffer);
|
||||||
PERROR("%s", buffer);
|
PERROR("%s", buffer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* finish mail */
|
/* finish mail */
|
||||||
fprintf(ph, ".\n");
|
fprintf(ph, ".\n");
|
||||||
|
|
Loading…
Reference in New Issue