diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2007-05-06 22:23:52 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2007-05-06 22:23:52 -0400 |
commit | 741e82fc69b69a3bfc14f33f33766a89cea4df42 (patch) | |
tree | 92830b34830f8ae07b251d96693c93392909d914 /src | |
parent | 9fa44396215d14644ecd5aa32c04327d4e6243a2 (diff) | |
download | lynx-snapshots-741e82fc69b69a3bfc14f33f33766a89cea4df42.tar.gz |
snapshot of project "lynx", label v2-8-7dev_4d
Diffstat (limited to 'src')
-rw-r--r-- | src/GridText.c | 2 | ||||
-rw-r--r-- | src/LYCurses.h | 8 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 3 | ||||
-rw-r--r-- | src/LYLeaks.c | 8 | ||||
-rw-r--r-- | src/LYMain.c | 13 | ||||
-rw-r--r-- | src/LYOptions.c | 35 | ||||
-rw-r--r-- | src/LYReadCFG.c | 5 | ||||
-rw-r--r-- | src/LYShowInfo.c | 3 | ||||
-rw-r--r-- | src/LYStyle.c | 2 | ||||
-rw-r--r-- | src/LYexit.c | 12 | ||||
-rw-r--r-- | src/LYrcFile.c | 10 | ||||
-rw-r--r-- | src/UCAux.c | 10 | ||||
-rw-r--r-- | src/UCdomap.c | 12 | ||||
-rw-r--r-- | src/Xsystem.c | 2 |
14 files changed, 89 insertions, 36 deletions
diff --git a/src/GridText.c b/src/GridText.c index fb455a71..4aa200f3 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -8035,7 +8035,7 @@ void print_crawl_to_fd(FILE *fp, char *thelink, * Add data. */ limit = TrimmedLength(line->data); - for (i = 0; limit; i++) { + for (i = 0; i < limit; i++) { int ch = UCH(line->data[i]); if (!IsSpecialAttrChar(ch)) { diff --git a/src/LYCurses.h b/src/LYCurses.h index 190c04b7..956033d1 100644 --- a/src/LYCurses.h +++ b/src/LYCurses.h @@ -1,3 +1,4 @@ +/* $LynxId: LYCurses.h,v 1.76 2007/05/06 20:46:34 tom Exp $ */ #ifndef LYCURSES_H #define LYCURSES_H @@ -264,7 +265,7 @@ typedef struct { #if defined(NCURSES_VERSION) #define USE_CURSES_NODELAY 1 #endif -#endif /* _WINDOWS || __MINGW32__ */ +#endif /* _WINDOWS || __MINGW32__ */ #if defined(NCURSES_VERSION) && defined(__BEOS__) #define USE_CURSES_NODELAY 1 @@ -363,6 +364,11 @@ extern "C" { #define SECS_FMT "%.0f" #endif +#ifdef NCURSES_VERSION + extern void _nc_freeall(void); /* HAVE__NC_FREEALL */ + extern void _nc_free_and_exit(int); /* HAVE__NC_FREE_AND_EXIT */ +#endif + /* Both slang and curses: */ #ifndef TRUE #define TRUE 1 diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 9372d7fd..41f30301 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -1,3 +1,4 @@ +/* $LynxId: LYGlobalDefs.h,v 1.105 2007/05/06 18:20:29 tom Exp $ */ /* global variable definitions */ #ifndef LYGLOBALDEFS_H @@ -538,7 +539,7 @@ extern "C" { extern int justify_max_void_percent; #endif -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET extern BOOLEAN LYLocaleCharset; #endif diff --git a/src/LYLeaks.c b/src/LYLeaks.c index 52c1c70c..f41d2a7e 100644 --- a/src/LYLeaks.c +++ b/src/LYLeaks.c @@ -1,5 +1,8 @@ /* + * $LynxId: LYLeaks.c,v 1.29 2007/05/06 21:43:33 tom Exp $ + * * Copyright (c) 1994, University of Kansas, All Rights Reserved + * (this file was rewritten twice - 1998/1999 and 2003/2004) * * This code will be used only if LY_FIND_LEAKS is defined. * @@ -174,6 +177,8 @@ void LYLeaks(void) size_t st_total = (size_t) 0; FILE *Fp_leakagesink; + CTRACE((tfp, "entering LYLeaks, flag=%d\n", LYfind_leaks)); + if (LYfind_leaks == FALSE) return; @@ -308,9 +313,6 @@ void LYLeaks(void) fclose(Fp_leakagesink); HTSYS_purge(LEAKAGE_SINK); -#if defined(NCURSES) && defined(HAVE__NC_FREEALL) - _nc_freeall(); -#endif } /* diff --git a/src/LYMain.c b/src/LYMain.c index af108097..bcacb611 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,3 +1,4 @@ +/* $LynxId: LYMain.c,v 1.170 2007/05/06 21:36:43 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> #include <HTParse.h> @@ -544,7 +545,7 @@ BOOL ok_justify = FALSE; int justify_max_void_percent = 35; #endif -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET BOOLEAN LYLocaleCharset = FALSE; #endif @@ -818,9 +819,6 @@ void reset_signals(void) void exit_immediately(int code) { reset_signals(); -#ifdef NCURSES_NO_LEAKS - _nc_freeall(); -#endif exit(code); } @@ -1083,7 +1081,7 @@ int main(int argc, #ifdef LY_FIND_LEAKS /* * Register the final function to be executed when being exited. Will - * display memory leaks if LY_FIND_LEAKS is defined. + * display memory leaks if the -find-leaks option is used. */ atexit(LYLeaks); /* @@ -1572,7 +1570,7 @@ int main(int argc, */ read_rc(NULL); -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET LYFindLocaleCharset(); #endif @@ -2064,9 +2062,6 @@ int main(int argc, LYSetConfigValue(RC_BROKEN_FTP_RETR, "ProFTPD 1.2.5"); LYSetConfigValue(RC_BROKEN_FTP_RETR, "spftp/"); LYSetConfigValue(RC_BROKEN_FTP_EPSV, "(Version wu-2.6.2-12)"); -#ifdef LY_FIND_LEAKS - atexit(broken_ftp_free); -#endif #endif /* diff --git a/src/LYOptions.c b/src/LYOptions.c index 61f3e49a..36609348 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -1,3 +1,4 @@ +/* $LynxId: LYOptions.c,v 1.120 2007/05/06 19:08:41 tom Exp $ */ #include <HTUtils.h> #include <HTFTP.h> #include <HTTP.h> /* 'reloading' flag */ @@ -279,6 +280,8 @@ void LYoptions(void) "CASE SENSITIVE", NULL }; + +#ifdef DIRED_SUPPORT static const char *dirList_choices[] = { "Directories first", @@ -286,6 +289,7 @@ void LYoptions(void) "Mixed style", NULL }; +#endif #if defined(ENABLE_OPTS_CHANGE_EXEC) && (defined(EXEC_LINKS) || defined(EXEC_SCRIPTS)) static const char *exec_choices[] = @@ -2309,7 +2313,7 @@ static const char *assume_char_set_string = RC_ASSUME_CHARSET; static const char *display_char_set_string = RC_CHARACTER_SET; static const char *raw_mode_string = RC_RAW_MODE; -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET static const char *locale_charset_string = RC_LOCALE_CHARSET; #endif @@ -2346,6 +2350,9 @@ static OptValues dired_sort_values[] = #endif /* LONG_LIST */ #endif /* DIRED_SUPPORT */ +#ifndef DISABLE_FTP +static const char *passive_ftp_string = RC_FTP_PASSIVE; + static const char *ftp_sort_string = RC_FILE_SORTING_METHOD; static OptValues ftp_sort_values[] = { @@ -2355,6 +2362,7 @@ static OptValues ftp_sort_values[] = {FILE_BY_DATE, N_("By Date"), "ftp_by_date"}, {0, 0, 0} }; +#endif #ifdef USE_READPROGRESS static const char *show_rate_string = RC_SHOW_KB_RATE; @@ -2956,7 +2964,7 @@ int postoptions(DocInfo *newdoc) assume_char_set_changed = TRUE; } } -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET /* Use locale-based character set: ON/OFF */ if (!strcmp(data[i].tag, locale_charset_string) && GetOptValues(bool_values, data[i].value, &code)) { @@ -2981,6 +2989,13 @@ int postoptions(DocInfo *newdoc) && GetOptValues(bool_values, data[i].value, &code)) { LYRawMode = (BOOL) code; } +#ifndef DISABLE_FTP + /* + * passive ftp: ON/OFF + */ + if (!strcmp(data[i].tag, passive_ftp_string)) { + ftp_passive = (BOOL) code; + } /* * ftp sort: SELECT @@ -2988,6 +3003,8 @@ int postoptions(DocInfo *newdoc) if (!strcmp(data[i].tag, ftp_sort_string)) { GetOptValues(ftp_sort_values, data[i].value, &HTfileSortMethod); } +#endif /* DISABLE_FTP */ + #ifdef DIRED_SUPPORT /* Local Directory Style: SELECT */ if (!strcmp(data[i].tag, dired_list_string)) { @@ -3062,7 +3079,7 @@ int postoptions(DocInfo *newdoc) /* * Process the flags: */ -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET LYFindLocaleCharset(); #endif @@ -3554,7 +3571,7 @@ static int gen_options(char **newfile) PutHeader(fp0, gettext("Display and Character Set")); /*****************************************************************/ -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET /* Use locale-based character set: ON/OFF */ PutLabel(fp0, gettext("Use locale-based character set"), locale_charset_string); BeginSelect(fp0, locale_charset_string); @@ -3724,7 +3741,7 @@ static int gen_options(char **newfile) PutTextInput(fp0, mail_address_string, NonNull(personal_mail_address), text_len, ""); - /* Mail Address: INPUT */ + /* Anonymous FTP Address: INPUT */ #ifndef DISABLE_FTP PutLabel(fp0, gettext("Password for anonymous ftp"), mail_address_string); PutTextInput(fp0, anonftp_password_string, @@ -3768,10 +3785,17 @@ static int gen_options(char **newfile) #ifndef DISABLE_FTP /* FTP sort: SELECT */ + PutLabel(fp0, gettext("Use Passive FTP"), passive_ftp_string); + BeginSelect(fp0, passive_ftp_string); + PutOptValues(fp0, ftp_passive, bool_values); + EndSelect(fp0); + + /* FTP sort: SELECT */ PutLabel(fp0, gettext("FTP sort criteria"), ftp_sort_string); BeginSelect(fp0, ftp_sort_string); PutOptValues(fp0, HTfileSortMethod, ftp_sort_values); EndSelect(fp0); +#endif /* DISABLE_FTP */ #ifdef DIRED_SUPPORT /* Local Directory Sort: SELECT */ @@ -3795,7 +3819,6 @@ static int gen_options(char **newfile) PutOptValues(fp0, show_dotfiles, bool_values); EndSelect(fp0); } -#endif /* DISABLE_FTP */ /* Execution links: SELECT */ #if defined(ENABLE_OPTS_CHANGE_EXEC) && (defined(EXEC_LINKS) || defined(EXEC_SCRIPTS)) diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index bcdfff19..59f623f6 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -1,3 +1,4 @@ +/* $LynxId: LYReadCFG.c,v 1.122 2007/05/06 18:17:23 tom Exp $ */ #ifndef NO_RULES #include <HTRules.h> #else @@ -1386,7 +1387,7 @@ static Config_Type Config_Table [] = PARSE_SET(RC_LIST_NEWS_DATES, LYListNewsDates), PARSE_SET(RC_LIST_NEWS_NUMBERS, LYListNewsNumbers), #endif -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET PARSE_SET(RC_LOCALE_CHARSET, LYLocaleCharset), #endif PARSE_STR(RC_LOCAL_DOMAIN, LYLocalDomain), @@ -1510,7 +1511,7 @@ static Config_Type Config_Table [] = PARSE_FUN(RC_SUFFIX_ORDER, suffix_order_fun), #ifdef SYSLOG_REQUESTED_URLS PARSE_SET(RC_SYSLOG_REQUESTED_URLS, syslog_requested_urls), - PARSE_SET(RC_SYSLOG_TEXT, syslog_txt), + PARSE_STR(RC_SYSLOG_TEXT, syslog_txt), #endif PARSE_FUN(RC_SYSTEM_EDITOR, system_editor_fun), PARSE_STR(RC_SYSTEM_MAIL, system_mail), diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c index 5133be88..2be79dd2 100644 --- a/src/LYShowInfo.c +++ b/src/LYShowInfo.c @@ -1,3 +1,4 @@ +/* $LynxId: LYShowInfo.c,v 1.65 2007/05/06 19:08:31 tom Exp $ */ #include <HTUtils.h> #include <HTFile.h> #include <HTParse.h> @@ -115,7 +116,6 @@ int LYShowInfo(DocInfo *doc, int url_type; FILE *fp0; char *Title = NULL; - const char *name; const char *cp; char *temp = 0; @@ -124,6 +124,7 @@ int LYShowInfo(DocInfo *doc, #endif #ifdef DIRED_SUPPORT struct stat dir_info; + const char *name; #endif /* DIRED_SUPPORT */ if (LYReuseTempfiles) { diff --git a/src/LYStyle.c b/src/LYStyle.c index c3e6f299..40ff1522 100644 --- a/src/LYStyle.c +++ b/src/LYStyle.c @@ -1,6 +1,6 @@ /* character level styles for Lynx * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-) - * @Id: LYStyle.c 1.63 Mon, 02 Oct 2006 12:56:53 -0700 dickey @ + * $LynxId: LYStyle.c,v 1.57 2006/10/02 20:07:15 tom Exp $ */ #include <HTUtils.h> #include <HTML.h> diff --git a/src/LYexit.c b/src/LYexit.c index 6baf2fc4..e5d06aec 100644 --- a/src/LYexit.c +++ b/src/LYexit.c @@ -1,5 +1,8 @@ /* + * $LynxId: LYexit.c,v 1.33 2007/05/06 21:41:43 tom Exp $ + * * Copyright (c) 1994, University of Kansas, All Rights Reserved + * (most of this file was rewritten in 1996 and 2004). */ #include <HTUtils.h> #include <LYexit.h> @@ -164,6 +167,15 @@ void LYexit(int status) LYCloseTracelog(); #endif /* !VMS */ show_alloc(); + +#if defined(NCURSES_VERSION) && defined(LY_FIND_LEAKS) +#if defined(HAVE__NC_FREE_AND_EXIT) + _nc_free_and_exit(status); +#elif defined(HAVE__NC_FREEALL) + _nc_freeall(); +#endif +#endif /* NCURSES_VERSION */ + exit(status); } diff --git a/src/LYrcFile.c b/src/LYrcFile.c index c2f90fb0..c3aa1c62 100644 --- a/src/LYrcFile.c +++ b/src/LYrcFile.c @@ -1,3 +1,4 @@ +/* $LynxId: LYrcFile.c,v 1.66 2007/05/06 19:22:33 tom Exp $ */ #include <HTUtils.h> #include <HTFTP.h> #include <LYUtils.h> @@ -322,12 +323,14 @@ prompt for each cookie. Set accept_all_cookies to \"TRUE\" to accept\n\ all cookies.\n\ ")), MAYBE_FUN(RC_ASSUME_CHARSET, get_assume_charset, put_assume_charset, MSG_ENABLE_LYNXRC), +#ifndef DISABLE_FTP PARSE_STR(RC_ANONFTP_PASSWORD, anonftp_password, N_("\ anonftp_password allows the user to tell Lynx to use the personal\n\ email address as the password for anonymous ftp. If no value is given,\n\ Lynx will use the personal email address. Set anonftp_password\n\ to a different value if you choose.\n\ ")), +#endif PARSE_STR(RC_BOOKMARK_FILE, bookmark_page, N_("\ bookmark_file specifies the name and location of the default bookmark\n\ file into which the user can paste links for easy access at a later\n\ @@ -397,6 +400,7 @@ or sending mail. If no editor is specified, then file editing is disabled\n\ unless it is activated from the command line, and the built-in line editor\n\ will be used for sending mail.\n\ ")), +#ifndef DISABLE_FTP PARSE_ENU(RC_FILE_SORTING_METHOD, HTfileSortMethod, tbl_file_sort, N_("\ The file_sorting_method specifies which value to sort on when viewing\n\ file lists such as FTP directories. The options are:\n\ @@ -405,12 +409,16 @@ file lists such as FTP directories. The options are:\n\ BY_SIZE -- sorts on the size of the file\n\ BY_DATE -- sorts on the date of the file\n\ ")), +#endif MAYBE_ENU(RC_FORCE_COOKIE_PROMPT, cookie_noprompt, tbl_force_prompt, MSG_ENABLE_LYNXRC), #ifdef USE_SSL MAYBE_ENU(RC_FORCE_SSL_PROMPT, ssl_noprompt, tbl_force_prompt, MSG_ENABLE_LYNXRC), #endif +#ifndef DISABLE_FTP + MAYBE_SET(RC_FTP_PASSIVE, ftp_passive, MSG_ENABLE_LYNXRC), +#endif #ifdef EXP_KEYBOARD_LAYOUT PARSE_ARY(RC_KBLAYOUT, current_layout, LYKbLayoutNames, NULL), #endif @@ -428,7 +436,7 @@ the following control characters are used for moving and deleting:\n\ \n\ Current lineedit modes are:\n\ ")), -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET MAYBE_SET(RC_LOCALE_CHARSET, LYLocaleCharset, MSG_ENABLE_LYNXRC), #endif MAYBE_SET(RC_MAKE_PSEUDO_ALTS_FOR_INLINES, pseudo_inline_alts, MSG_ENABLE_LYNXRC), diff --git a/src/UCAux.c b/src/UCAux.c index 49b8692e..d041ee8e 100644 --- a/src/UCAux.c +++ b/src/UCAux.c @@ -340,9 +340,10 @@ void UCSetBoxChars(int cset, */ #ifdef EXP_CHARTRANS_AUTOSWITCH /* US-ASCII vs Latin-1 is safe (usually) */ - if (cset == US_ASCII && linedrawing_char_set == LATIN1) { - ; - } else if (cset == LATIN1 && linedrawing_char_set == US_ASCII) { + if ((cset == US_ASCII + || cset == LATIN1) + && (linedrawing_char_set == US_ASCII + || linedrawing_char_set == LATIN1)) { ; } #if defined(NCURSES_VERSION) || defined(HAVE_TIGETSTR) @@ -402,7 +403,8 @@ void UCSetBoxChars(int cset, int test = UCTransUniChar(table[n].internal, cset); if (test != table[n].external) { - CTRACE((tfp, "line-drawing map %c mismatch (have %#x, want %#x)\n", + CTRACE((tfp, + "line-drawing map %c mismatch (have %#x, want %#x)\n", table[n].mapping, test, table[n].external)); fix_lines = TRUE; diff --git a/src/UCdomap.c b/src/UCdomap.c index bb2204e5..452a0a09 100644 --- a/src/UCdomap.c +++ b/src/UCdomap.c @@ -1,4 +1,6 @@ /* + * $LynxId: UCdomap.c,v 1.64 2007/05/06 18:20:48 tom Exp $ + * * UCdomap.c * ========= * @@ -25,7 +27,7 @@ #include <UCDefs.h> #include <LYCharSets.h> -#if defined(EXP_LOCALE_CHARSET) && defined(HAVE_LANGINFO_CODESET) +#if defined(USE_LOCALE_CHARSET) && defined(HAVE_LANGINFO_CODESET) #include <langinfo.h> #endif @@ -2219,9 +2221,9 @@ int safeUCGetLYhndl_byMIME(const char *value) return (i); } -#ifdef EXP_LOCALE_CHARSET +#ifdef USE_LOCALE_CHARSET -#if defined(EXP_LOCALE_CHARSET) && !defined(HAVE_LANGINFO_CODESET) +#if defined(USE_LOCALE_CHARSET) && !defined(HAVE_LANGINFO_CODESET) /* * This is a quick-and-dirty emulator of the nl_langinfo(CODESET) * function defined in the Single Unix Specification for those systems @@ -2361,7 +2363,7 @@ static char *nl_langinfo(nl_item item) } return C_CODESET; } -#endif /* defined(EXP_LOCALE_CHARSET) && !defined(HAVE_LANGINFO_CODESET) */ +#endif /* defined(USE_LOCALE_CHARSET) && !defined(HAVE_LANGINFO_CODESET) */ /* * If LYLocaleCharset is true, use the current locale to lookup a MIME name @@ -2404,4 +2406,4 @@ void LYFindLocaleCharset(void) current_char_set = linedrawing_char_set; } } -#endif /* EXP_LOCALE_CHARSET */ +#endif /* USE_LOCALE_CHARSET */ diff --git a/src/Xsystem.c b/src/Xsystem.c index a5335501..15a8dfd6 100644 --- a/src/Xsystem.c +++ b/src/Xsystem.c @@ -1,4 +1,4 @@ -/* @Id: Xsystem.c 1.15 Thu, 30 Dec 2004 04:11:59 -0800 dickey @ +/* $LynxId: Xsystem.c,v 1.16 2004/12/30 12:20:28 tom Exp $ * like system("cmd") but return with exit code of "cmd" * for Turbo-C/MS-C/LSI-C * This code is in the public domain. |