about summary refs log tree commit diff stats
path: root/src/LYMail.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2011-05-27 00:46:17 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2011-05-27 00:46:17 -0400
commit6aab9ce5aeba97b6afee05e377027c3c1544583d (patch)
treecb93a1f5c0191da0b64b553990fe5ae2c5c9fb95 /src/LYMail.c
parent35794979cb285352b58cdf1879ca9cc246168729 (diff)
downloadlynx-snapshots-6aab9ce5aeba97b6afee05e377027c3c1544583d.tar.gz
snapshot of project "lynx", label v2-8-8dev_8g
Diffstat (limited to 'src/LYMail.c')
-rw-r--r--src/LYMail.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/LYMail.c b/src/LYMail.c
index ba9d3b48..4a43564f 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMail.c,v 1.80 2010/12/11 14:52:59 tom Exp $
+ * $LynxId: LYMail.c,v 1.82 2011/05/26 01:00:05 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTParse.h>
@@ -327,7 +327,7 @@ static char *blat_cmd(char *mail_cmd,
 		      char *ccaddr,
 		      char *mail_addr)
 {
-    static char *b_cmd;
+    char *b_cmd = NULL;
 
 #ifdef USE_ALT_BLAT_MAILER
 
@@ -343,7 +343,7 @@ static char *blat_cmd(char *mail_cmd,
 
 #else /* !USE_ALT_BLAT_MAILER */
 
-    static char bl_cmd_file[512];
+    char bl_cmd_file[LY_MAXPATH];
     FILE *fp;
 
 #ifdef __CYGWIN__
@@ -467,31 +467,24 @@ int LYSendMailFile(char *the_address,
 		   char *message)
 {
     char *cmd = NULL;
-
-#ifdef __DJGPP__
-    char *shell;
-#endif /* __DJGPP__ */
     int code;
 
     if (!LYSystemMail())
 	return 0;
 
 #if USE_BLAT_MAILER
-    if (mail_is_blat)
-	StrAllocCopy(cmd,
-		     blat_cmd(system_mail,
-			      the_filename,
-			      the_address,
-			      the_subject,
-			      the_ccaddr,
-			      personal_mail_address
-		     )
-	    );
-    else
+    if (mail_is_blat) {
+	cmd = blat_cmd(system_mail,
+		       the_filename,
+		       the_address,
+		       the_subject,
+		       the_ccaddr,
+		       personal_mail_address);
+    } else
 #endif
 #ifdef __DJGPP__
-    if ((shell = LYGetEnv("SHELL")) != NULL) {
-	if (strstr(shell, "sh") != NULL) {
+    if (LYGetEnv("SHELL")) {
+	if (dj_is_bash) {
 	    HTSprintf0(&cmd, "%s -c %s -t \"%s\" -F %s",
 		       shell,
 		       system_mail,
@@ -504,18 +497,12 @@ int LYSendMailFile(char *the_address,
 		       the_address,
 		       the_filename);
 	}
-    } else {
-	HTSprintf0(&cmd, "%s -t \"%s\" -F %s",
-		   system_mail,
-		   the_address,
-		   the_filename);
-    }
-#else
+    } else
+#endif /* __DJGPP__ */
 	HTSprintf0(&cmd, "%s -t \"%s\" -F %s",
 		   system_mail,
 		   the_address,
 		   the_filename);
-#endif /* __DJGPP__ */
 
     stop_curses();
     SetOutputMode(O_TEXT);