diff options
-rw-r--r-- | CHANGES | 8 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 3 | ||||
-rw-r--r-- | src/LYMail.c | 74 | ||||
-rw-r--r-- | src/LYMail.h | 30 | ||||
-rw-r--r-- | src/LYMain.c | 24 | ||||
-rw-r--r-- | userdefs.h | 34 |
6 files changed, 108 insertions, 65 deletions
diff --git a/CHANGES b/CHANGES index 44429536..7102c949 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,13 @@ --- $LynxId: CHANGES,v 1.543 2011/05/27 00:46:17 tom Exp $ +-- $LynxId: CHANGES,v 1.544 2011/05/27 09:50:23 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2011-05-26 (2.8.8dev.9) +2011-05-27 (2.8.8dev.9) +* modify blat/blatj configuration so that support for both is compiled-in + for DOSPATH configurations. Add "-altblat" option to select blat vs blatj. + Define USE_ALT_BLAT_MAILER to specify which is the default (prompted by + report by LarryL) -TD * correct an interaction between LYCloseOutput() and LYRemoveTemp() as used in send_file_to_mail(), to allow a temporary file to be closed and used by external program before removing it -TD diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 353b18e5..c72dbb38 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYGlobalDefs.h,v 1.128 2010/12/11 14:19:17 tom Exp $ + * $LynxId: LYGlobalDefs.h,v 1.129 2011/05/27 08:39:07 tom Exp $ * * global variable definitions */ @@ -652,6 +652,7 @@ extern "C" { extern BOOLEAN no_table_center; #if USE_BLAT_MAILER + extern BOOLEAN mail_is_altblat; extern BOOLEAN mail_is_blat; #endif diff --git a/src/LYMail.c b/src/LYMail.c index 4a43564f..188bf144 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMail.c,v 1.82 2011/05/26 01:00:05 tom Exp $ + * $LynxId: LYMail.c,v 1.83 2011/05/27 08:51:44 tom Exp $ */ #include <HTUtils.h> #include <HTParse.h> @@ -329,57 +329,57 @@ static char *blat_cmd(char *mail_cmd, { char *b_cmd = NULL; -#ifdef USE_ALT_BLAT_MAILER + if (mail_is_altblat) { - HTSprintf0(&b_cmd, "%s %s -t \"%s\" -s \"%s\" %s%s%s%s", - mail_cmd, - filename, - address, - subject, - system_mail_flags, - ccaddr ? " -c \"" : "", - NonNull(ccaddr), - ccaddr ? "\"" : ""); + HTSprintf0(&b_cmd, "%s %s -t \"%s\" -s \"%s\" %s%s%s%s", + mail_cmd, + filename, + address, + subject, + system_mail_flags, + ccaddr ? " -c \"" : "", + NonNull(ccaddr), + ccaddr ? "\"" : ""); -#else /* !USE_ALT_BLAT_MAILER */ + } else { - char bl_cmd_file[LY_MAXPATH]; - FILE *fp; + char bl_cmd_file[LY_MAXPATH]; + FILE *fp; #ifdef __CYGWIN__ - char dosname[LY_MAXPATH]; + char dosname[LY_MAXPATH]; #endif - bl_cmd_file[0] = '\0'; - if ((fp = LYOpenTemp(bl_cmd_file, ".blt", "w")) == NULL) { - HTAlert(FORM_MAILTO_FAILED); - return NULL; - } + bl_cmd_file[0] = '\0'; + if ((fp = LYOpenTemp(bl_cmd_file, ".blt", "w")) == NULL) { + HTAlert(FORM_MAILTO_FAILED); + return NULL; + } #ifdef __CYGWIN__ - cygwin_conv_to_full_win32_path(filename, dosname); - fprintf(fp, "%s\n", dosname); + cygwin_conv_to_full_win32_path(filename, dosname); + fprintf(fp, "%s\n", dosname); #else - fprintf(fp, "%s\n", filename); + fprintf(fp, "%s\n", filename); #endif - fprintf(fp, "-t\n%s\n", address); - if (subject) - fprintf(fp, "-s\n%s\n", subject); - if (non_empty(mail_addr)) { - fprintf(fp, "-f\n%s\n", mail_addr); - } - if (non_empty(ccaddr)) { - fprintf(fp, "-c\n%s\n", ccaddr); - } - LYCloseOutput(fp); + fprintf(fp, "-t\n%s\n", address); + if (subject) + fprintf(fp, "-s\n%s\n", subject); + if (non_empty(mail_addr)) { + fprintf(fp, "-f\n%s\n", mail_addr); + } + if (non_empty(ccaddr)) { + fprintf(fp, "-c\n%s\n", ccaddr); + } + LYCloseOutput(fp); #ifdef __CYGWIN__ - cygwin_conv_to_full_win32_path(bl_cmd_file, dosname); - HTSprintf0(&b_cmd, "%s \"@%s\"", mail_cmd, dosname); + cygwin_conv_to_full_win32_path(bl_cmd_file, dosname); + HTSprintf0(&b_cmd, "%s \"@%s\"", mail_cmd, dosname); #else - HTSprintf0(&b_cmd, "%s @%s", mail_cmd, bl_cmd_file); + HTSprintf0(&b_cmd, "%s @%s", mail_cmd, bl_cmd_file); #endif -#endif /* USE_ALT_BLAT_MAILER */ + } return b_cmd; } diff --git a/src/LYMail.h b/src/LYMail.h index cf7e0552..96d0fc9f 100644 --- a/src/LYMail.h +++ b/src/LYMail.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYMail.h,v 1.14 2011/05/26 09:23:05 tom Exp $ + * $LynxId: LYMail.h,v 1.15 2011/05/27 09:54:07 tom Exp $ */ #ifndef LYMAIL_H #define LYMAIL_H @@ -17,16 +17,44 @@ extern "C" { #define USE_BLAT_MAILER 1 #endif +#ifndef USE_ALTBLAT_MAILER +#define USE_ALTBLAT_MAILER 0 +#endif + #ifndef USE_BLAT_MAILER #define USE_BLAT_MAILER 0 #endif +#ifdef USE_BLAT_MAILER + +#undef SYSTEM_MAIL +#undef SYSTEM_MAIL_FLAGS + +#ifdef USE_ALT_BLAT_MAILER +#define SYSTEM_MAIL ALTBLAT_MAIL +#define SYSTEM_MAIL_FLAGS "" +#else +#define SYSTEM_MAIL BLAT_MAIL +#define SYSTEM_MAIL_FLAGS "" +#define USE_ALT_BLAT_MAILER 0 +#endif + +#endif /* USE_BLAT_MAILER */ + #ifdef VMS #define USE_VMS_MAILER 1 #else #define USE_VMS_MAILER 0 #endif +#ifndef SYSTEM_MAIL +#define SYSTEM_MAIL "sendmail" +#endif + +#ifndef SYSTEM_MAIL_FLAGS +#define SYSTEM_MAIL_FLAGS "" +#endif + /* * Ifdef's in case we have a working popen/pclose, useful for piping to the * mail program. diff --git a/src/LYMain.c b/src/LYMain.c index 04fc5db0..01b21c5d 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMain.c,v 1.227 2011/05/23 22:55:22 Scott.Harrod Exp $ + * $LynxId: LYMain.c,v 1.228 2011/05/27 09:51:51 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> @@ -16,6 +16,7 @@ #include <HTML.h> #include <LYUtils.h> #include <LYGlobalDefs.h> +#include <LYMail.h> #include <LYOptions.h> #include <LYSignal.h> #include <LYGetFile.h> @@ -350,6 +351,15 @@ BOOLEAN no_table_center = FALSE; /* 1998/10/09 (Fri) 15:12:49 */ #if USE_BLAT_MAILER BOOLEAN mail_is_blat = TRUE; +BOOLEAN mail_is_altblat = USE_ALTBLAT_MAILER; + +#if USE_ALTBLAT_MAILER +#define THIS_BLAT_MAIL ALTBLAT_MAIL +#define THAT_BLAT_MAIL BLAT_MAIL +#else +#define THIS_BLAT_MAIL BLAT_MAIL +#define THAT_BLAT_MAIL ALTBLAT_MAIL +#endif #endif #ifdef USE_BLINK @@ -1154,11 +1164,7 @@ int main(int argc, StrAllocCopy(language, PREFERRED_LANGUAGE); StrAllocCopy(pref_charset, PREFERRED_CHARSET); StrAllocCopy(system_mail, SYSTEM_MAIL); -#ifdef SYSTEM_MAIL_FLAGS StrAllocCopy(system_mail_flags, SYSTEM_MAIL_FLAGS); -#else - StrAllocCopy(system_mail_flags, ""); -#endif StrAllocCopy(LYUserAgent, LYNX_NAME); StrAllocCat(LYUserAgent, "/"); @@ -3271,6 +3277,12 @@ static Config_Type Arg_Table [] = "accept_all_cookies", 4|SET_ARG, LYAcceptAllCookies, "\naccept cookies without prompting if Set-Cookie handling\nis on" ), +#if USE_BLAT_MAILER + PARSE_SET( + "altblat", 4|TOGGLE_ARG, mail_is_altblat, + "select mail tool (`"THIS_BLAT_MAIL"' ==> `"THAT_BLAT_MAIL"')" + ), +#endif PARSE_FUN( "anonymous", 2|FUNCTION_ARG, anonymous_fun, "apply restrictions for anonymous account,\nsee also -restrictions" @@ -3587,7 +3599,7 @@ soon as they are seen)" #if USE_BLAT_MAILER PARSE_SET( "noblat", 4|TOGGLE_ARG, mail_is_blat, - "select mail tool (`BLAT' ==> `sendmail')" + "select mail tool (`"THIS_BLAT_MAIL"' ==> `sendmail')" ), #endif PARSE_FUN( diff --git a/userdefs.h b/userdefs.h index c79108e2..4707e5b9 100644 --- a/userdefs.h +++ b/userdefs.h @@ -1,5 +1,5 @@ /* - * $LynxId: userdefs.h,v 1.263 2011/01/10 10:22:59 tom Exp $ + * $LynxId: userdefs.h,v 1.264 2011/05/27 09:33:23 tom Exp $ * * Lynx - Hypertext navigation system * @@ -1497,6 +1497,14 @@ #endif /* FNAMES_8_3 */ #endif +#ifndef BLAT_MAIL +#define BLAT_MAIL "blat" +#endif + +#ifndef ALTBLAT_MAIL +#define ALTBLAT_MAIL "blatj" +#endif + #define BIN_SUFFIX ".bin" #define TEXT_SUFFIX ".txt" @@ -1517,27 +1525,17 @@ #ifdef DOSPATH #ifdef _WINDOWS -#ifdef SYSTEM_MAIL -#undef SYSTEM_MAIL -#endif -#ifdef SYSTEM_MAIL_FLAGS -#undef SYSTEM_MAIL_FLAGS -#endif -#ifdef USE_ALT_BLAT_MAILER -#define SYSTEM_MAIL "BLAT" -#define SYSTEM_MAIL_FLAGS "" -#else -#define SYSTEM_MAIL "BLATJ" -#define SYSTEM_MAIL_FLAGS "" + +#ifndef USE_BLAT_MAILER +#define USE_BLAT_MAILER 1 #endif + #else /* have to define something... */ -#ifdef SYSTEM_MAIL #undef SYSTEM_MAIL -#endif /* SYSTEM_MAIL */ -#define SYSTEM_MAIL "sendmail" -#define SYSTEM_MAIL_FLAGS "-t -oi" -#endif +#define SYSTEM_MAIL "sendmail" +#define SYSTEM_MAIL_FLAGS "-t -oi" +#endif /* _WINDOWS */ /* ** The following executables may be used at run time. Unless you change |