diff options
Diffstat (limited to 'src/LYMail.c')
-rw-r--r-- | src/LYMail.c | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/src/LYMail.c b/src/LYMail.c index a0855064..0a2cc1c6 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -308,7 +308,7 @@ PUBLIC void mailform ARGS4( PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address, char *,filename, char *,linkname) { - FILE *fd; + FILE *fd, *fp; char *address = NULL; char cmd[512], *cp, *cp0, *cp1; int i; @@ -349,7 +349,7 @@ PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address, #ifdef UNIX #ifdef MMDF - sprintf(cmd, "%s -mlruxto,cc\\*",system_mail); + sprintf(cmd, "%s -mlruxto,cc\\*", system_mail); #else sprintf(cmd, "%s -t -oi", system_mail); #endif /* MMDF */ @@ -362,27 +362,32 @@ PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address, fprintf(fd,"To: %s\n", address); fprintf(fd,"Subject: Lynx Error in %s\n", filename); fprintf(fd,"X-URL: %s\n", filename); - fprintf(fd,"X-Mailer: Lynx, Version %s\n\n",LYNX_VERSION); + fprintf(fd,"X-Mailer: Lynx, Version %s\n\n", LYNX_VERSION); #endif /* UNIX */ #ifdef VMS - sprintf(tmpfile,"%s%s",lynx_temp_space, "temp_mail.txt"); + sprintf(tmpfile, "%s%s", lynx_temp_space, "temp_mail.txt"); if ((fd = fopen(tmpfile,"w")) == NULL) { FREE(address); return; } - #endif /* VMS */ fprintf(fd, "The link %s :?: %s \n", links[cur].lname, links[cur].target); - fprintf(fd, "called \"%s\"\n",links[cur].hightext); + fprintf(fd, "called \"%s\"\n", links[cur].hightext); fprintf(fd, "in the file \"%s\" called \"%s\"", filename, linkname); fputs("\nwas requested but was not available.",fd); fputs("\n\nThought you might want to know.",fd); - fputs("\n\nThis message was automatically generated by\n",fd); - fprintf(fd,"Lynx ver. %s",LYNX_VERSION); + fputs("\n\nThis message was automatically generated by\n", fd); + fprintf(fd, "Lynx ver. %s", LYNX_VERSION); + if ((LynxSigFile != NULL) && + (fp = fopen(LynxSigFile, "r")) != NULL) { + while (fgets(cmd, sizeof(cmd), fp) != NULL) + fputs(cmd, fd); + fclose(fp); + } #ifdef UNIX pclose(fd); #endif /* UNIX */ @@ -451,7 +456,7 @@ PUBLIC void reply_by_mail ARGS3( char *, title) { char user_input[1000]; - FILE *fd; + FILE *fd, *fp; char *address = NULL; char *searchpart = NULL; char *body = NULL; @@ -468,7 +473,6 @@ PUBLIC void reply_by_mail ARGS3( #else char buf[512]; char *header = NULL; - FILE *fp; int n; #endif /* VMS */ @@ -1031,12 +1035,30 @@ PUBLIC void reply_by_mail ARGS3( while (TOUPPER(c) != 'Y' && TOUPPER(c) != 'N' && !term_letter && c != 7 && c != 3) c = LYgetch(); - - clear(); /* Clear the screen. */ - if (TOUPPER(c) != 'Y') { + clear(); /* clear the screen */ goto cleanup; } + if ((body == NULL && LynxSigFile != NULL) && + (fp = fopen(LynxSigFile, "r")) != NULL) { + LYStatusLine = (LYlines - 1); + _user_message(APPEND_SIG_FILE, LynxSigFile); + c = 0; + LYStatusLine = -1; + while (TOUPPER(c) != 'Y' && TOUPPER(c) != 'N' && + !term_letter && c != 7 && c != 3) + c = LYgetch(); + if (TOUPPER(c) == 'Y') { + if ((fd = fopen(tmpfile, "a")) != NULL) { + while (fgets(user_input, sizeof(user_input), fp) != NULL) { + fputs(user_input, fd); + } + fclose(fd); + } + } + fclose(fp); + } + clear(); /* Clear the screen. */ /* * Send the message. |