diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2000-02-25 12:43:29 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2000-02-25 12:43:29 -0500 |
commit | 184855c6f7b9e1727a8f419b475b1fffd9292911 (patch) | |
tree | 1bd2388be832a1908b0f03cf89dcfa70e4a31ebb /src | |
parent | 59ec2705df06b90f10f9ff6eeadfffcd02bbd39a (diff) | |
download | lynx-snapshots-184855c6f7b9e1727a8f419b475b1fffd9292911.tar.gz |
snapshot of project "lynx", label v2-8-3dev_21
Diffstat (limited to 'src')
-rw-r--r-- | src/DefaultStyle.c | 2 | ||||
-rw-r--r-- | src/GridText.c | 17 | ||||
-rw-r--r-- | src/GridText.h | 30 | ||||
-rw-r--r-- | src/HTFont.h | 36 | ||||
-rw-r--r-- | src/HTML.c | 1 | ||||
-rw-r--r-- | src/LYCharSets.c | 1 | ||||
-rw-r--r-- | src/LYCharUtils.c | 1 | ||||
-rw-r--r-- | src/LYEdit.c | 27 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 24 | ||||
-rw-r--r-- | src/LYKeymap.c | 39 | ||||
-rw-r--r-- | src/LYKeymap.h | 4 | ||||
-rw-r--r-- | src/LYMain.c | 13 | ||||
-rw-r--r-- | src/LYMainLoop.c | 109 | ||||
-rw-r--r-- | src/LYNews.c | 48 | ||||
-rw-r--r-- | src/LYReadCFG.c | 4 | ||||
-rw-r--r-- | src/UCdomap.c | 14 |
16 files changed, 200 insertions, 170 deletions
diff --git a/src/DefaultStyle.c b/src/DefaultStyle.c index 9532c973..c3b2eb66 100644 --- a/src/DefaultStyle.c +++ b/src/DefaultStyle.c @@ -4,8 +4,8 @@ */ #include <HTUtils.h> -#include <HTStyle.h> #include <HTFont.h> +#include <HTStyle.h> #include <LYLeaks.h> diff --git a/src/GridText.c b/src/GridText.c index 2082036c..a8687293 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -4,7 +4,6 @@ #include <HTUtils.h> #include <HTString.h> -#include <HTFont.h> #include <HTAccess.h> #include <HTAnchor.h> #include <HTParse.h> @@ -3809,7 +3808,7 @@ PUBLIC void HText_appendCharacter ARGS2( ) && ((unsigned char)ch >= 0xA1) && ((unsigned char)ch <= 0xDF)) { -#ifdef CONV_JISX0201KANA_ISX0208KANA +#ifdef CONV_JISX0201KANA_JISX0208KANA unsigned char c = (unsigned char)ch; unsigned char kb = (unsigned char)text->kanji_buf; JISx0201TO0208_SJIS(c, @@ -4297,7 +4296,7 @@ check_WrapSource: line->data[line->size++] = tmp[0]; line->data[line->size++] = tmp[1]; } else if (IS_EUC(hi, lo)) { -#ifdef CONV_JISX0201KANA_ISX0208KANA +#ifdef CONV_JISX0201KANA_JISX0208KANA JISx0201TO0208_EUC(hi, lo, &hi, &lo); #endif line->data[line->size++] = hi; @@ -4312,7 +4311,7 @@ check_WrapSource: case SJIS: if ((text->kcode == EUC) || (text->kcode == JIS)) { -#ifndef CONV_JISX0201KANA_ISX0208KANA +#ifndef CONV_JISX0201KANA_JISX0208KANA if (IS_EUC_X0201KANA(hi, lo)) line->data[line->size++] = lo; else @@ -10191,7 +10190,8 @@ PUBLIC int HText_SubmitForm ARGS4( anchor_ptr = HTMainText->first_anchor; while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR) { - if (anchor_ptr->input_field->number == form_number) { + if (anchor_ptr->input_field->number == form_number && + !anchor_ptr->input_field->disabled) { char *p; char * val; @@ -10375,7 +10375,8 @@ PUBLIC int HText_SubmitForm ARGS4( */ while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR) { - if (anchor_ptr->input_field->number == form_number) { + if (anchor_ptr->input_field->number == form_number && + !anchor_ptr->input_field->disabled) { char *p; int out_cs; form_ptr = anchor_ptr->input_field; @@ -11443,11 +11444,7 @@ PUBLIC void HText_setKcode ARGS3( ** If we get to here, it's not CJK, so disable that if ** it is enabled. But only if we are quite sure. - FM & kw */ -#ifdef KANJI_CODE_OVERRIDE - last_kcode = text->kcode = NOKANJI; -#else text->kcode = NOKANJI; -#endif if (HTCJK != NOCJK) { if (!p_in || p_in->enc != UCT_ENC_CJK) HTCJK = NOCJK; diff --git a/src/GridText.h b/src/GridText.h index da17b203..22116f3c 100644 --- a/src/GridText.h +++ b/src/GridText.h @@ -10,35 +10,7 @@ #include <HTForms.h> #endif /* HTFORMS_H */ -#ifndef HT_NON_BREAK_SPACE -#define HT_NON_BREAK_SPACE ((char)1) /* remember it */ -#endif /* !HT_NON_BREAK_SPACE */ -#ifndef HT_EN_SPACE -#define HT_EN_SPACE ((char)2) /* remember it */ -#endif /* !HT_EN_SPACE */ -#define LY_UNDERLINE_START_CHAR '\003' -#define LY_UNDERLINE_END_CHAR '\004' - -/* Turn about is fair play ASCII platforms use EBCDIC tab; - EBCDIC platforms use ASCII tab for LY_BOLD_START_CHAR. -*/ -#ifdef EBCDIC -#define LY_BOLD_START_CHAR '\011' -#else -#define LY_BOLD_START_CHAR '\005' -#endif - -#define LY_BOLD_END_CHAR '\006' -#ifndef LY_SOFT_HYPHEN -#define LY_SOFT_HYPHEN ((char)7) -#endif /* !LY_SOFT_HYPHEN */ -#define LY_SOFT_NEWLINE ((char)8) - -#ifdef EBCDIC -#define IsSpecialAttrChar(a) (((a) > '\002') && ((a) <= '\011') && ((a)!='\t')) -#else -#define IsSpecialAttrChar(a) (((a) > '\002') && ((a) <= '\010')) -#endif +#include <HTFont.h> #define TABSTOP 8 #define SPACES " " /* must be at least TABSTOP spaces long */ diff --git a/src/HTFont.h b/src/HTFont.h index 9e7a9202..9404b88f 100644 --- a/src/HTFont.h +++ b/src/HTFont.h @@ -8,14 +8,6 @@ typedef long int HTMLFont; /* For now */ -#ifndef HT_NON_BREAK_SPACE -#define HT_NON_BREAK_SPACE ((char)1) /* For now */ -#endif /* !HT_NON_BREAK_SPACE */ -#ifndef HT_EN_SPACE -#define HT_EN_SPACE ((char)2) /* For now */ -#endif /* !HT_EN_SPACE */ - - #define HT_FONT 0 #define HT_CAPITALS 1 #define HT_BOLD 2 @@ -26,4 +18,32 @@ typedef long int HTMLFont; /* For now */ #define HT_BLACK 0 #define HT_WHITE 1 +/* +** Lynx internal character representations. +*/ +#define HT_NON_BREAK_SPACE ((char)1) +#define HT_EN_SPACE ((char)2) +#define LY_UNDERLINE_START_CHAR '\003' +#define LY_UNDERLINE_END_CHAR '\004' + +/* Turn about is fair play ASCII platforms use EBCDIC tab; + EBCDIC platforms use ASCII tab for LY_BOLD_START_CHAR. +*/ +#ifdef EBCDIC +#define LY_BOLD_START_CHAR '\011' +#else +#define LY_BOLD_START_CHAR '\005' +#endif + +#define LY_BOLD_END_CHAR '\006' +#define LY_SOFT_HYPHEN ((char)7) +#define LY_SOFT_NEWLINE ((char)8) + +#ifdef EBCDIC +#define IsSpecialAttrChar(a) (((a) > '\002') && ((a) <= '\011') && ((a)!='\t')) +#else +#define IsSpecialAttrChar(a) (((a) > '\002') && ((a) <= '\010')) +#endif + + #endif /* HTFONT_H */ diff --git a/src/HTML.c b/src/HTML.c index 95a59897..e79ef01e 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -35,7 +35,6 @@ #include <LYCharSets.h> #include <HTAlert.h> -#include <HTFont.h> #include <HTForms.h> #include <HTNestedList.h> #include <GridText.h> diff --git a/src/LYCharSets.c b/src/LYCharSets.c index 62e1fdfc..6120a5a2 100644 --- a/src/LYCharSets.c +++ b/src/LYCharSets.c @@ -6,7 +6,6 @@ #include <UCMap.h> #include <UCDefs.h> #include <LYCharSets.h> -#include <HTFont.h> #include <GridText.h> #include <LYCurses.h> #include <LYStrings.h> diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c index d4227365..b5e8f58d 100644 --- a/src/LYCharUtils.c +++ b/src/LYCharUtils.c @@ -25,7 +25,6 @@ #include <LYCharSets.h> #include <HTAlert.h> -#include <HTFont.h> #include <HTForms.h> #include <HTNestedList.h> #include <GridText.h> diff --git a/src/LYEdit.c b/src/LYEdit.c index e9b9a88d..cd2bbbb0 100644 --- a/src/LYEdit.c +++ b/src/LYEdit.c @@ -13,15 +13,30 @@ PUBLIC BOOLEAN editor_can_position NOARGS { + static CONST char *table[] = { #ifdef VMS - return (strstr(editor, "sedt") || strstr(editor, "SEDT")); + "sedt", + "SEDT" #else - return (strstr(editor, "emacs") || strstr(editor, "vi") || - strstr(editor, "pico") || strstr(editor, "jove") || - strstr(editor, "jed") || strstr(editor, "joe") || - strstr(editor, "jstar") || strstr(editor, "jmacs") || - strstr(editor, "rjoe") || strstr(editor, "jpico")); + "emacs", + "jed", + "jmacs", + "joe", + "jove", + "jpico", + "jstar", + "pico", + "rjoe", + "vi" #endif + }; + unsigned n; + for (n = 0; n < TABLESIZE(table); n++) { + if (strstr(editor, table[n]) != 0) { + return TRUE; + } + } + return FALSE; } /* diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index b39fe04a..14cdc76d 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -171,6 +171,7 @@ extern BOOLEAN dump_output_immediately; extern BOOLEAN emacs_keys; /* TRUE to turn on emacs-like key movement */ extern BOOLEAN error_logging; /* TRUE to mail error messages */ extern BOOLEAN ftp_ok; +extern BOOLEAN ftp_passive; /* TRUE if we want to use passive mode ftp */ extern BOOLEAN goto_buffer; /* TRUE if offering default goto URL */ extern BOOLEAN is_www_index; extern BOOLEAN jump_buffer; /* TRUE if offering default shortcut */ @@ -381,15 +382,19 @@ extern char *LYCookieSRejectDomains; /* domains to reject all cookies */ extern char *LYCookieSStrictCheckDomains;/* domains to check strictly */ extern char *LYCookieSLooseCheckDomains;/* domains to check loosely */ extern char *LYCookieSQueryCheckDomains;/* domains to check w/a query */ + #ifdef EXP_PERSISTENT_COOKIES extern BOOLEAN persistent_cookies; extern char *LYCookieFile; /* cookie read file */ extern char *LYCookieSaveFile; /* cookie save file */ #endif /* EXP_PERSISTENT_COOKIES */ + extern char *XLoadImageCommand; /* Default image viewer for X */ + #ifdef USE_EXTERNALS extern BOOLEAN no_externals; /* don't allow the use of externals */ #endif + extern BOOLEAN LYNoISMAPifUSEMAP; /* Omit ISMAP link if MAP present? */ extern int LYHiddenLinks; @@ -400,24 +405,24 @@ extern BOOL Old_DTD; * Arrays that holds the names of sub-bookmark files * and their descriptions. */ -extern char *MBM_A_subbookmark[MBM_V_MAXFILES+1]; -extern char *MBM_A_subdescript[MBM_V_MAXFILES+1]; -extern FILE *LYTraceLogFP; /* Pointer for TRACE log */ -extern char *LYTraceLogPath; /* Path for TRACE log */ -extern BOOLEAN LYUseTraceLog; /* Use a TRACE log? */ -extern BOOLEAN LYSeekFragMAPinCur; -extern BOOLEAN LYSeekFragAREAinCur; -extern BOOLEAN LYStripDotDotURLs; /* Try to fix ../ in some URLs? */ extern BOOLEAN LYForceSSLCookiesSecure; extern BOOLEAN LYNoCc; +extern BOOLEAN LYNonRestartingSIGWINCH; extern BOOLEAN LYPreparsedSource; /* Show source as preparsed? */ extern BOOLEAN LYPrependBaseToSource; extern BOOLEAN LYPrependCharsetToSource; extern BOOLEAN LYQuitDefaultYes; -extern BOOLEAN LYNonRestartingSIGWINCH; extern BOOLEAN LYReuseTempfiles; +extern BOOLEAN LYSeekFragAREAinCur; +extern BOOLEAN LYSeekFragMAPinCur; +extern BOOLEAN LYStripDotDotURLs; /* Try to fix ../ in some URLs? */ extern BOOLEAN LYUseBuiltinSuffixes; +extern BOOLEAN LYUseTraceLog; /* Use a TRACE log? */ extern BOOLEAN dont_wrap_pre; +extern FILE *LYTraceLogFP; /* Pointer for TRACE log */ +extern char *LYTraceLogPath; /* Path for TRACE log */ +extern char *MBM_A_subbookmark[MBM_V_MAXFILES+1]; +extern char *MBM_A_subdescript[MBM_V_MAXFILES+1]; #ifdef MISC_EXP extern int LYNoZapKey; /* 0: off (do 'z' checking), 1: full, 2: initially */ @@ -433,6 +438,7 @@ extern BOOLEAN with_backspaces; #endif extern BOOL force_empty_hrefless_a; +extern int connect_timeout; #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION extern BOOL textfields_need_activation; diff --git a/src/LYKeymap.c b/src/LYKeymap.c index a21e4003..dbde16f1 100644 --- a/src/LYKeymap.c +++ b/src/LYKeymap.c @@ -99,19 +99,14 @@ LYK_TRACE_TOGGLE, 0, LYK_SWITCH_DTD, LYK_REFRESH, LYK_NEXT_PAGE, LYK_SHELL, LYK_SOFT_DQUOTES, LYK_TOOLBAR, /* sp */ /* ! */ /* " */ /* # */ -0, 0, 0, LYK_HISTORICAL, +LYK_LAST_LINK, 0, 0, LYK_HISTORICAL, /* $ */ /* % */ /* & */ /* ' */ LYK_UP_HALF, LYK_DOWN_HALF, LYK_IMAGE_TOGGLE, LYK_NEXT_PAGE, /* ( */ /* ) */ /* * */ /* + */ -#ifndef USE_EXTERNALS -LYK_NEXT_PAGE, LYK_PREV_PAGE, 0, LYK_WHEREIS, -/* , */ /* - */ /* . */ /* / */ -#else LYK_NEXT_PAGE, LYK_PREV_PAGE, LYK_EXTERN, LYK_WHEREIS, /* , */ /* - */ /* . */ /* / */ -#endif LYK_F_LINK_NUM, LYK_1, LYK_2, LYK_3, /* 0 */ /* 1 */ /* 2 */ /* 3 */ @@ -128,18 +123,8 @@ LYK_UP_LINK, LYK_INFO, LYK_DOWN_LINK, LYK_HELP, LYK_RAW_TOGGLE, LYK_ADDRLIST, LYK_PREV_PAGE, LYK_COMMENT, /* @ */ /* A */ /* B */ /* C */ -LYK_DOWNLOAD, LYK_ELGOTO, -/* D */ /* E */ - -#if defined(DIRED_SUPPORT) || defined(VMS) -LYK_DIRED_MENU, -#else -0, -#endif /* DIRED_SUPPORT || VMS */ -/* F */ - -LYK_ECGOTO, -/* G */ +LYK_DOWNLOAD, LYK_ELGOTO, LYK_DIRED_MENU, LYK_ECGOTO, +/* D */ /* E */ /* F */ /* G */ LYK_HELP, LYK_INDEX, LYK_JUMP, LYK_KEYMAP, /* H */ /* I */ /* J */ /* K */ @@ -156,24 +141,14 @@ LYK_TAG_LINK, LYK_PREV_DOC, LYK_VLINKS, 0, LYK_NOCACHE, 0, LYK_INTERRUPT, LYK_INLINE_TOGGLE, /* X */ /* Y */ /* Z */ /* [ */ -LYK_SOURCE, LYK_HEAD, 0, LYK_CLEAR_AUTH, +LYK_SOURCE, LYK_HEAD, LYK_FIRST_LINK, LYK_CLEAR_AUTH, /* \ */ /* ] */ /* ^ */ /* _ */ LYK_MINIMAL, LYK_ADD_BOOKMARK, LYK_PREV_PAGE, LYK_COMMENT, /* ` */ /* a */ /* b */ /* c */ -LYK_DOWNLOAD, LYK_EDIT, -/* d */ /* e */ - -#if defined(DIRED_SUPPORT) || defined(VMS) -LYK_DIRED_MENU, -#else -0, -#endif /* DIRED_SUPPORT || VMS */ -/* f */ - -LYK_GOTO, -/* g */ +LYK_DOWNLOAD, LYK_EDIT, LYK_DIRED_MENU, LYK_GOTO, +/* d */ /* e */ /* f */ /* g */ LYK_HELP, LYK_INDEX, LYK_JUMP, LYK_KEYMAP, /* h */ /* i */ /* j */ /* k */ @@ -672,6 +647,8 @@ PRIVATE struct rmap revmap[] = { { "REFRESH", "refresh the screen to clear garbled text" }, { "HOME", "go to the beginning of the current document" }, { "END", "go to the end of the current document" }, +{ "FIRST_LINK", "make the first link on the line current" }, +{ "LAST_LINK", "make the last link on the line current" }, { "PREV_LINK", "make the previous link current" }, { "NEXT_LINK", "make the next link current" }, { "LPOS_PREV_LINK", "make previous link current, same column for input" }, diff --git a/src/LYKeymap.h b/src/LYKeymap.h index bd0048b8..f58b54a9 100644 --- a/src/LYKeymap.h +++ b/src/LYKeymap.h @@ -136,6 +136,8 @@ typedef enum { , LYK_REFRESH , LYK_HOME , LYK_END + , LYK_FIRST_LINK + , LYK_LAST_LINK , LYK_PREV_LINK , LYK_NEXT_LINK , LYK_LPOS_PREV_LINK @@ -206,6 +208,8 @@ typedef enum { #ifdef USE_EXTERNALS , LYK_EXTERN +#else +#define LYK_EXTERN LYK_UNKNOWN #endif /* !defined(USE_EXTERNALS) */ #if defined(VMS) || defined(DIRED_SUPPORT) diff --git a/src/LYMain.c b/src/LYMain.c index 52c8600b..1313b2dd 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -164,6 +164,7 @@ PUBLIC BOOLEAN LYUserSpecifiedURL = TRUE;/* always TRUE the first time */ PUBLIC BOOLEAN LYJumpFileURL = FALSE; /* always FALSE the first time */ PUBLIC BOOLEAN jump_buffer = JUMPBUFFER; /* TRUE if offering default shortcut */ PUBLIC BOOLEAN goto_buffer = GOTOBUFFER; /* TRUE if offering default goto URL */ +PUBLIC BOOLEAN ftp_passive = FTP_PASSIVE; /* TRUE if doing ftp in passive mode */ PUBLIC BOOLEAN recent_sizechange = FALSE;/* the window size changed recently? */ PUBLIC int user_mode = NOVICE_MODE; PUBLIC BOOLEAN dump_output_immediately = FALSE; @@ -438,6 +439,8 @@ PUBLIC BOOLEAN LYPrependCharsetToSource = TRUE; PUBLIC BOOLEAN LYQuitDefaultYes = QUIT_DEFAULT_YES; PUBLIC BOOLEAN dont_wrap_pre = FALSE; +PUBLIC int connect_timeout = 18000;/*=180000*0.1 - used in HTDoConnect.*/ + #ifdef EXP_JUSTIFY_ELTS PUBLIC BOOL ok_justify = TRUE; PUBLIC int justify_max_void_percent = 35; @@ -3159,6 +3162,12 @@ static Parse_Args_Type Arg_Table [] = "force color mode on with standard bg colors" ), #endif +#ifndef __DJGPP__ + PARSE_SET( + "connect_timeout", NEED_INT_ARG, &connect_timeout, + "=N\nset the N-second connection timeout" + ), +#endif #ifdef MISC_EXP PARSE_SET( "convert_to", FUNCTION_ARG, convert_to_fun, @@ -3208,8 +3217,8 @@ with -dump, format output as with -traversal, but to stdout" ), PARSE_SET( "dont_wrap_pre", SET_ARG, &dont_wrap_pre, - "inhibit wrapping of text in <pre> when -dump'ing and \n" - "-crawl'ing, mark wrapped lines in interactive session" + "inhibit wrapping of text in <pre> when -dump'ing and \n\ +-crawl'ing, mark wrapped lines in interactive session" ), PARSE_FUN( "dump", FUNCTION_ARG, dump_output_fun, diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 5704abd1..b3f0f624 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -446,16 +446,24 @@ PUBLIC void LYMainLoop_pageDisplay ARGS1( } +PRIVATE void set_curdoc_link ARGS1( + int, nextlink) +{ + if (curdoc.link != nextlink + && nextlink >= 0 + && nextlink < nlinks) { + if (curdoc.link >= 0 && curdoc.link < nlinks) + highlight(OFF, curdoc.link, prev_target); + curdoc.link = nextlink; + } +} + PRIVATE int do_change_link NOARGS { /* Is there a mouse-clicked link waiting? */ int mouse_tmp = get_mouse_link(); /* If yes, use it as the link */ if (mouse_tmp != -1) { - if (curdoc.link >= 0 && curdoc.link < nlinks - && curdoc.link != mouse_tmp) { - highlight(OFF, curdoc.link, prev_target); - } if (mouse_tmp < 0 || mouse_tmp >= nlinks) { char *msgtmp = NULL; HTSprintf0(&msgtmp, @@ -465,7 +473,7 @@ PRIVATE int do_change_link NOARGS FREE(msgtmp); return(-1); /* indicates unexpected error */ } - curdoc.link = mouse_tmp; + set_curdoc_link(mouse_tmp); } return(0); /* indicates OK */ } @@ -2229,10 +2237,9 @@ PRIVATE void handle_LYK_DOWN_LINK ARGS3( newlink = find_link_near_col(*follow_col, 1); if (newlink > -1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = newlink; + set_curdoc_link(newlink); } else if (more) { /* next page */ - Newline += (display_lines); + Newline += (display_lines); } else if (*old_c != real_c) { *old_c = real_c; HTUserMsg(NO_LINKS_BELOW); @@ -2743,8 +2750,7 @@ PRIVATE BOOLEAN handle_LYK_FASTBACKW_LINK ARGS3( nextlink--; } } - highlight(OFF, curdoc.link, prev_target); - curdoc.link = nextlink; + set_curdoc_link(nextlink); return FALSE; /* and we are done. */ } else if (Newline > 1 && /* need a previous page */ @@ -2813,8 +2819,7 @@ PRIVATE void handle_LYK_FASTFORW_LINK ARGS2( } } if (samepage) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = nextlink; + set_curdoc_link(nextlink); return; /* and we are done. */ /* @@ -2822,8 +2827,7 @@ PRIVATE void handle_LYK_FASTFORW_LINK ARGS2( * Move to the top link on the page. */ } else if (!more && Newline == 1 && curdoc.link == nlinks-1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = 0; + set_curdoc_link(0); } else if (more && /* need a later page */ HTGetLinkOrFieldStart(curdoc.link, @@ -2839,6 +2843,18 @@ PRIVATE void handle_LYK_FASTFORW_LINK ARGS2( return; } +PRIVATE void handle_LYK_FIRST_LINK NOARGS +{ + int i; + + for (i = curdoc.link - 1; i >= 0; i--) { + if (links[i].ly != links[curdoc.link].ly) { + set_curdoc_link(i + 1); + break; + } + } +} + PRIVATE BOOLEAN handle_LYK_GOTO ARGS9( int *, ch, char *, user_input_buffer, @@ -3509,12 +3525,23 @@ PRIVATE void handle_LYK_KEYMAP ARGS4( } } +PRIVATE void handle_LYK_LAST_LINK NOARGS +{ + int i; + + for (i = curdoc.link; i < nlinks; i++) { + if (links[i].ly != links[curdoc.link].ly) { + set_curdoc_link(i - 1); + break; + } + } +} + PRIVATE void handle_LYK_LEFT_LINK NOARGS { if (curdoc.link>0 && links[curdoc.link].ly == links[curdoc.link-1].ly) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link--; + set_curdoc_link(curdoc.link-1); } } @@ -3869,11 +3896,10 @@ PRIVATE void handle_LYK_NEXT_LINK ARGS3( * Move to the top link on the page. */ } else if (!more && Newline == 1 && curdoc.link == nlinks-1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = 0; + set_curdoc_link(0); } else if (more) { /* next page */ - Newline += (display_lines); + Newline += (display_lines); } else if (*old_c != real_c) { *old_c = real_c; @@ -3888,8 +3914,7 @@ PRIVATE void handle_LYK_NEXT_PAGE ARGS2( if (more) { Newline += display_lines; } else if (curdoc.link < nlinks-1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = nlinks-1; /* put on last link */ + set_curdoc_link(nlinks - 1); } else if (*old_c != real_c) { *old_c = real_c; HTInfoMsg(ALREADY_AT_END); @@ -3924,22 +3949,16 @@ PRIVATE void handle_LYK_PREV_LINK ARGS3( int, real_c) { if (curdoc.link > 0) { /* previous link */ - /* - * Unhighlight current link. - */ - highlight(OFF, curdoc.link, prev_target); - curdoc.link--; + set_curdoc_link(curdoc.link - 1); } else if (!more && curdoc.link==0 && Newline==1) { /* at the top of list */ /* * If there is only one page of data and the user - * goes off the top, then unhighlight the current - * link and just move the cursor to last link on + * goes off the top, just move the cursor to last link on * the page. */ - highlight(OFF, curdoc.link, prev_target); - curdoc.link = nlinks-1; /* the last link */ + set_curdoc_link(nlinks - 1); } else if (curdoc.line > 1) { /* previous page */ /* @@ -4082,8 +4101,7 @@ PRIVATE void handle_LYK_PREV_PAGE ARGS2( if (Newline > 1) { Newline -= display_lines; } else if (curdoc.link > 0) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = 0; /* put on first link */ + set_curdoc_link(0); } else if (*old_c != real_c) { *old_c = real_c; HTInfoMsg(ALREADY_AT_BEGIN); @@ -4245,8 +4263,7 @@ PRIVATE void handle_LYK_RIGHT_LINK NOARGS { if (curdoc.link<nlinks-1 && links[curdoc.link].ly == links[curdoc.link+1].ly) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link++; + set_curdoc_link(curdoc.link + 1); } } @@ -4469,11 +4486,9 @@ PRIVATE void handle_LYK_TAG_LINK NOARGS } } if (curdoc.link < nlinks-1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link++; + set_curdoc_link(curdoc.link + 1); } else if (!more && Newline == 1 && curdoc.link == nlinks-1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = 0; + set_curdoc_link(0); } else if (more) { /* next page */ Newline += (display_lines); } @@ -4653,8 +4668,7 @@ PRIVATE void handle_LYK_UP_LINK ARGS4( newlink = find_link_near_col(*follow_col, -1); if (newlink > -1) { - highlight(OFF, curdoc.link, prev_target); - curdoc.link = newlink; + set_curdoc_link(newlink); } else if (*old_c != real_c) { *old_c = real_c; HTUserMsg(NO_LINKS_ABOVE); @@ -5005,13 +5019,8 @@ PRIVATE void handle_LYK_digit ARGS6( } else { /* * It's a different link on this page, - * so turn the highlighting off, set the - * current link to the new link value from - * follow_link_number(), and re-initialize - * the new link value. - FM */ - highlight(OFF, curdoc.link, prev_target); - curdoc.link = newdoc.link; + set_curdoc_link(newdoc.link); newdoc.link = 0; } } @@ -6861,6 +6870,14 @@ new_cmd: /* } break; + case LYK_FIRST_LINK: + handle_LYK_FIRST_LINK(); + break; + + case LYK_LAST_LINK: + handle_LYK_LAST_LINK(); + break; + case LYK_PREV_LINK: case LYK_LPOS_PREV_LINK: handle_LYK_PREV_LINK(&arrowup, &old_c, real_c); diff --git a/src/LYNews.c b/src/LYNews.c index 0a031c93..910f8a9b 100644 --- a/src/LYNews.c +++ b/src/LYNews.c @@ -29,13 +29,16 @@ PRIVATE void terminate_message PARAMS((int sig)); extern HTCJKlang HTCJK; #endif -PRIVATE BOOLEAN message_has_content ARGS1( - CONST char *, filename) +PRIVATE BOOLEAN message_has_content ARGS2( + CONST char *, filename, + BOOLEAN *, nonspaces) { FILE *fp; char *buffer = NULL; BOOLEAN in_headers = TRUE; + *nonspaces = FALSE; + if (!filename || (fp = fopen(filename, "r")) == NULL) { CTRACE((tfp, "Failed to open file %s for reading!\n", NONNULL(filename))); @@ -53,14 +56,19 @@ PRIVATE BOOLEAN message_has_content ARGS1( } else if (*cp != ' ') { if (!firstnonblank && isgraph((unsigned char)*cp)) { firstnonblank = *cp; + } else if (!isspace((unsigned char)*cp)) { + *nonspaces = TRUE; } } } if (*cp != '\n') { int c; - while ((c = getc(fp)) != EOF && c != (int)(unsigned char)'\n') { - if (!firstnonblank && isgraph((unsigned char)c)) + while ((c = getc(fp)) != EOF && c != '\n') { + if (!firstnonblank && isgraph((unsigned char)c)) { firstnonblank = (char)c; + } else if (!isspace((unsigned char)*cp)) { + *nonspaces = TRUE; + } } } if (firstnonblank && firstnonblank != '>') { @@ -109,6 +117,7 @@ PUBLIC char *LYNewsPost ARGS2( char *org = NULL; FILE *fp = NULL; BOOLEAN nonempty = FALSE; + BOOLEAN nonspaces = FALSE; /* * Make sure a non-zero length newspost, newsreply, @@ -378,7 +387,7 @@ PUBLIC char *LYNewsPost ARGS2( start_curses(); } - nonempty = message_has_content(my_tempfile); + nonempty = message_has_content(my_tempfile, &nonspaces); } else { /* @@ -417,20 +426,23 @@ PUBLIC char *LYNewsPost ARGS2( scrollok(stdscr, FALSE); /* Stop scrolling. */ } - if (!nonempty) { + if (nonempty) { + /* + * Confirm whether to post, and if so, + * whether to append the sig file. - FM + */ + LYStatusLine = (LYlines - 1); + c = HTConfirm(POST_MSG_PROMPT); + LYStatusLine = -1; + if (c != YES) { + clear(); /* clear the screen */ + goto cleanup; + } + } else { HTAlert(gettext("Message has no original text!")); - goto cleanup; - } - /* - * Confirm whether to post, and if so, - * whether to append the sig file. - FM - */ - LYStatusLine = (LYlines - 1); - c = HTConfirm(POST_MSG_PROMPT); - LYStatusLine = -1; - if (c != YES) { - clear(); /* clear the screen */ - goto cleanup; + if (!nonspaces + || HTConfirmDefault(POST_MSG_PROMPT, NO) != YES) + goto cleanup; } if ((LynxSigFile != NULL) && (fp = fopen(LynxSigFile, TXT_R)) != NULL) { char *msg = NULL; diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 48398fdd..bfaa0de1 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -1318,6 +1318,9 @@ static Config_Type Config_Table [] = #ifdef USE_COLOR_TABLE PARSE_FUN("color", CONF_FUN, color_fun), #endif +#ifndef __DJGPP__ + PARSE_INT("connect_timeout",CONF_INT,&connect_timeout), +#endif PARSE_STR("cookie_accept_domains", CONF_STR, &LYCookieSAcceptDomains), #ifdef EXP_PERSISTENT_COOKIES PARSE_STR("cookie_file", CONF_STR, &LYCookieFile), @@ -1363,6 +1366,7 @@ static Config_Type Config_Table [] = #if !defined(NO_OPTION_FORMS) && !defined(NO_OPTION_MENU) PARSE_SET("forms_options", CONF_BOOL, &LYUseFormsOptions), #endif + PARSE_SET("ftp_passive", CONF_BOOL, &ftp_passive), PARSE_ENV("ftp_proxy", CONF_ENV, 0 ), PARSE_STR("global_extension_map", CONF_STR, &global_extension_map), PARSE_STR("global_mailcap", CONF_STR, &global_type_map), diff --git a/src/UCdomap.c b/src/UCdomap.c index 48991d6a..64875fef 100644 --- a/src/UCdomap.c +++ b/src/UCdomap.c @@ -1728,9 +1728,9 @@ PRIVATE CONST char ** UC_setup_LYCharSets_repl ARGS2( { CONST char **ISO_Latin1 = LYCharSets[0]; CONST char **p; - char **prepl; + CONST char **prepl; CONST u16 *pp; - char **tp; + CONST char **tp; CONST char *s7; CONST char *s8; size_t i; @@ -1741,7 +1741,7 @@ PRIVATE CONST char ** UC_setup_LYCharSets_repl ARGS2( /* * Create a temporary table for reverse lookup of latin1 codes: */ - tp = (char **)malloc(96 * sizeof(CONST char *)); + tp = (CONST char **)malloc(96 * sizeof(CONST char *)); if (!tp) return NULL; for (i = 0; i < 96; i++) @@ -1786,7 +1786,7 @@ PRIVATE CONST char ** UC_setup_LYCharSets_repl ARGS2( list = UCInfo[UC_charset_in_hndl].replacedesc.entries; while (ct--) { if ((k = list->unicode) >= 160 && k < 256) { - tp[k-160] = (char *)(list->replace_str); + tp[k-160] = list->replace_str; } list++; } @@ -1795,14 +1795,14 @@ PRIVATE CONST char ** UC_setup_LYCharSets_repl ARGS2( * Now allocate a new table compatible with LYCharSets[] * and with the HTMLDTD for entities. * We don't know yet whether we'll keep it around. */ - prepl = (char **)malloc(HTML_dtd.number_of_entities * sizeof(char *)); + prepl = (CONST char **)malloc(HTML_dtd.number_of_entities * sizeof(char *)); if (!prepl) { FREE(tp); FREE(ti); return 0; } - p = (CONST char **)prepl; + p = prepl; changed = 0; for (i = 0; i < HTML_dtd.number_of_entities; i++, p++) { /* @@ -1873,7 +1873,7 @@ PRIVATE CONST char ** UC_setup_LYCharSets_repl ARGS2( FREE(prepl); return NULL; } - return (CONST char **)prepl; + return prepl; } /* |