diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1999-08-13 13:40:41 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1999-08-13 13:40:41 -0400 |
commit | fde43024bd6579b609526faf94dcdbcb6f2bc5e1 (patch) | |
tree | 1d4accd9602108b3cc2693d6c0093469274cc332 | |
parent | 9c512bbadc47a7de000f53f11a7620d83ca0ddba (diff) | |
download | lynx-snapshots-fde43024bd6579b609526faf94dcdbcb6f2bc5e1.tar.gz |
snapshot of project "lynx", label v2-8-3dev_6
-rw-r--r-- | CHANGES | 32 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFTP.c | 9 | ||||
-rw-r--r-- | docs/README.defines | 3 | ||||
-rw-r--r-- | lynx.cfg | 17 | ||||
-rw-r--r-- | lynx.hlp | 131 | ||||
-rw-r--r-- | lynx.man | 6 | ||||
-rw-r--r-- | lynx_help/Lynx_users_guide.html | 18 | ||||
-rw-r--r-- | makefile.in | 11 | ||||
-rw-r--r-- | src/GridText.c | 209 | ||||
-rw-r--r-- | src/HTAlert.c | 4 | ||||
-rw-r--r-- | src/HTFWriter.c | 5 | ||||
-rw-r--r-- | src/LYCookie.c | 10 | ||||
-rw-r--r-- | src/LYCookie.h | 4 | ||||
-rw-r--r-- | src/LYDownload.c | 2 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 8 | ||||
-rw-r--r-- | src/LYHash.h | 3 | ||||
-rw-r--r-- | src/LYMain.c | 70 | ||||
-rw-r--r-- | src/LYMainLoop.c | 308 | ||||
-rw-r--r-- | src/LYReadCFG.c | 4 | ||||
-rw-r--r-- | src/LYStrings.c | 20 | ||||
-rw-r--r-- | src/LYStyle.c | 12 | ||||
-rw-r--r-- | src/LYUtils.c | 12 | ||||
-rw-r--r-- | userdefs.h | 4 |
23 files changed, 618 insertions, 284 deletions
diff --git a/CHANGES b/CHANGES index 42896c59..e14bbdd5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,38 @@ Changes since Lynx 2.8 release =============================================================================== +1999-08-13 (2.8.3dev.6) +* workarounds in LYMain.c and LYMainLoop.c for excessive compiler warnings due + to defective design of glibc2 -TD +* modify logic for EXP_JUSTIFY_ELTS in GridText.c to change a raw + LY_NONBREAK_SPACE to ' ', to work better for tables -VH +* add/clarify user's guide for command line option syntax -DK, KW +* add a new command line toggle for DOS to control debugging of packets under + WATTCP and WATT-32. Under WATT-32, once dbug_init is called, debugging + cannot be turned off (although output can be sent to /dev/null). This new + option "-wdebug" controls whether debugging is active, is off by default -DK, + Gisle Vanem +* allow ':' as a separator between the option and its value -DK +* corrected install rule using symbolic link for copyright files (reported by + HN, KED) -TD +* reset "stalled for xxx" counter from Ilya's ETA change in dev.5 between ftp + requests -VH +* add support for scrollbars, ifdef'd with USE_SCROLLBAR. Use command-line + options -scrollbar and -scrollbar_arrow or corresponding lynx.cfg to enable + it. Requires ncurses; may be further tuned if color-style configuration + is used (Ilya Zakharevich) +* LYCopyFile(): Thanks to Hiroyuki Senshu, DOS-based systems needs no cp.exe + binary when compiled with SH_EX. This code is now defined with DOSPATH so + used automatically by any dos/windows port, but unused for UNIXes + (permissions?) if occasionally built with SH_EX symbol -LP +* few includes labelled with _WIN_CC now tweaked with WIN_EX as should be -LP +* adjustments to SH_EX, CJK_EX ifdef's in LYMainLoop.c and LYUtils.c to aid in + porting -LP +* improved logic in status_link() for -short_url option (patches from + <nsh@itjit.ne.jp> and Eduardo Chappa L) +* modify display_page() to not necessarily call lynx_force_repaint() to make + highlighting work when displaying UTF-8 -Christian Weisgerber, KW +* add check in read_directory() if transfer was interrupted -KED 1999-07-30 (2.8.3dev.5) * add/use LYHideCursor() macro to accommodate position in older curses -TD * add configure option --enable-cjk to compile-in CJK_EX logic -TD diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 208020da..32349c8a 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -2751,7 +2751,7 @@ unload_btree: entry_info->size); else sprintf(string_buffer, "%6d Kb", - entry_info->size/1024); + entry_info->size/1024); #else if (entry_info->size < 1024) sprintf(string_buffer, " %d bytes", @@ -2776,10 +2776,13 @@ unload_btree: FREE(lastpath); if (server_type == APPLESHARE_SERVER || - server_type == NETPRESENZ_SERVER) { + server_type == NETPRESENZ_SERVER || + WasInterrupted) { /* * Without closing the data socket first, * the response(NIL) below hangs. - KW + * Seems to also be needed if the xfer + * was interrupted ("z" or ^G). - KED */ NETCLOSE(data_soc); } @@ -2819,12 +2822,12 @@ PUBLIC int HTFTPLoad ARGS4( int retry; /* How many times tried? */ HTFormat format; - /* set use_list to NOT since we don't know what kind of server * this is yet. And set the type to GENERIC */ use_list = FALSE; server_type = GENERIC_SERVER; + HTReadProgress(0,0); for (retry = 0; retry < 2; retry++) { /* For timed out/broken connections */ status = get_connection(name, anchor); diff --git a/docs/README.defines b/docs/README.defines index 982447e0..8f059ada 100644 --- a/docs/README.defines +++ b/docs/README.defines @@ -84,8 +84,7 @@ Using curses or ncurses library: # -DNO_SIZECHANGE (old) or HAVE_SIZECHANGE (new) whether using code to detect new size after size changes of the terminal (window). for UNIX handled by ./configure, may be set in HTUtils.h -# -DUSE_SIZECHANGEHACK gone (was: enable hack to handle increasing the - window size above window size at startup) +# -DUSE_SCROLLBAR supports scrollbar when built with ncurses Using slang library: # -DUSE_SLANG (see INSTALLATION, Section II-1c) diff --git a/lynx.cfg b/lynx.cfg index d6a5759c..9185d036 100644 --- a/lynx.cfg +++ b/lynx.cfg @@ -876,6 +876,21 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html # #LYNX_SIG_FILE:.lynxsig +# If SCROLLBAR is set TRUE, Lynx will show scrollbar on windows. With mouse +# enabled, the scrollbar strip outside the bar is clickable, and scrolls the +# window by pages. The appearance of the scrollbar can be changed from +# LYNX_LSS file: define attributes scroll.bar, scroll.back (for the bar, and +# for the strip along which the scrollbar moves). +#SCROLLBAR:FALSE + +# If SCROLLBAR_ARROW is set TRUE, Lynx's scrollbar will have arrows at the +# ends. With mouse enabled, the arrows are clickable, and scroll the window by +# 2 lines. The appearance of the scrollbar arrows can be changed from LYNX_LSS +# file: define attributes scroll.arrow, scroll.noarrow (for enabled-arrows, +# and disabled arrows). An arrow is "disabled" if the bar is at this end of +# the strip. +#SCROLLBAR_ARROW:TRUE + # If USE_MOUSE is set TRUE, Lynx (when configured with ncurses) will allow # the user to click with button-1 on links to select them. #USE_MOUSE:FALSE @@ -2225,6 +2240,8 @@ MINIMAL_COMMENTS:TRUE # true, most of text (except headers and like this) will be justified. This # has no influence on CJK text rendering. # +# This option is only available if Lynx was compiled with EXP_JUSTIFY_ELTS. +# #JUSTIFY:TRUE # STICKY_INPUTS - Input diff --git a/lynx.hlp b/lynx.hlp index 2125fcc2..0fcc06f9 100644 --- a/lynx.hlp +++ b/lynx.hlp @@ -243,7 +243,7 @@ enabled). -mime_header - prints the MIME header of a fetched document along + prints the MIME header of a fetched document along with its source. -minimal @@ -253,25 +253,25 @@ number of articles in chunked news listings. -newsmaxchunk=NUMBER - maximum news articles in listings before chunking. + maximum news articles in listings before chunking. -nobrowse disable directory browsing. - -nocc disable Cc: prompts for self copies of mailings. - Note that this does not disable any CCs which are + -nocc disable Cc: prompts for self copies of mailings. + Note that this does not disable any CCs which are incorporated within a mailto URL or form ACTION. -nocolor force color mode off, overriding terminal - capabilities and any -color flags, COLORTERM + capabilities and any -color flags, COLORTERM variable, and saved .lynxrc settings. -noexec disable local program execution. (DEFAULT) -nofilereferer - disable transmissions of Referer headers for file + disable transmissions of Referer headers for file URLs. -nolist @@ -281,10 +281,10 @@ owners. -nonrestarting_sigwinch - This flag is not available on all systems, Lynx - needs to be compiled with HAVE_SIGACTION defined. - If available, this flag may cause Lynx to react - more immediately to window changes when run within + This flag is not available on all systems, Lynx + needs to be compiled with HAVE_SIGACTION defined. + If available, this flag may cause Lynx to react + more immediately to window changes when run within an xterm. -nopause @@ -317,23 +317,23 @@ with partial-display logic -pauth=ID:PASSWD - set authorization ID and password for a protected - proxy server at startup. Be sure to protect any + set authorization ID and password for a protected + proxy server at startup. Be sure to protect any script files which use this switch. - -popup toggles handling of single-choice SELECT options + -popup toggles handling of single-choice SELECT options via popup windows or as lists of radio buttons. -post_data - send form data from stdin using POST method and + send form data from stdin using POST method and dump results. -preparsed - show HTML source preparsed and reformatted when + show HTML source preparsed and reformatted when used with -source or in source view. -prettysrc - show HTML source view with lexical elements and + show HTML source view with lexical elements and tags in color. -print enable print functions. (default) @@ -341,8 +341,8 @@ -pseudo_inlines toggles pseudo-ALTs for inlines with no ALT string. - -raw toggles default setting of 8-bit character - translations or CJK mode for the startup character + -raw toggles default setting of 8-bit character + translations or CJK mode for the startup character set. -realm restricts access to URLs in the starting realm. @@ -352,33 +352,32 @@ document affected). -restrictions=[option][,option][,option]... - allows a list of services to be disabled + allows a list of services to be disabled selectively. Dashes and underscores in option names can be intermixed. The following list is printed if no options are specified. all - restricts all options listed below. - bookmark - disallow changing the location of the + bookmark - disallow changing the location of the bookmark file. - bookmark_exec - disallow execution links via the + bookmark_exec - disallow execution links via the bookmark file. - change_exec_perms - disallow changing the eXecute - permission on files (but still allow it for + change_exec_perms - disallow changing the eXecute + permission on files (but still allow it for directories) when local file management is enabled. - default - same as command line option -anonymous. - + default - same as command line option -anonymous. Disables default services for anonymous users. Set - to all restricted, except for: inside_telnet, - outside_telnet, inside_ftp, outside_ftp, + to all restricted, except for: inside_telnet, + outside_telnet, inside_ftp, outside_ftp, inside_rlogin, outside_rlogin, inside_news, outside_news, telnet_port, jump, mail, print, exec, - and goto. The settings for these, as well as - additional goto restrictions for specific URL - schemes that are also applied, are derived from + and goto. The settings for these, as well as + additional goto restrictions for specific URL + schemes that are also applied, are derived from definitions within userdefs.h. dired_support - disallow local file management. @@ -386,43 +385,43 @@ disk_save - disallow saving to disk in the download and print menus. - dotfiles - disallow access to, or creation of, + dotfiles - disallow access to, or creation of, hidden (dot) files. - download - disallow some downloaders in the - download menu (does not imply disk_save + download - disallow some downloaders in the + download menu (does not imply disk_save restriction). editor - disallow external editing. exec - disable execution scripts. - exec_frozen - disallow the user from changing the + exec_frozen - disallow the user from changing the local execution option. - externals - disallow some "EXTERNAL" configuration - lines if support for passing URLs to external - applications (with the EXTERN command) is compiled + externals - disallow some "EXTERNAL" configuration + lines if support for passing URLs to external + applications (with the EXTERN command) is compiled in. - file_url - disallow using G)oto, served links or + file_url - disallow using G)oto, served links or bookmarks for file: URLs. goto - disable the 'g' (goto) command. - inside_ftp - disallow ftps for people coming from + inside_ftp - disallow ftps for people coming from inside your domain (utmp required for selectivity). - inside_news - disallow USENET news posting for - people coming from inside your domain (utmp + inside_news - disallow USENET news posting for + people coming from inside your domain (utmp required for selectivity). - inside_rlogin - disallow rlogins for people coming - from inside your domain (utmp required for + inside_rlogin - disallow rlogins for people coming + from inside your domain (utmp required for selectivity). - inside_telnet - disallow telnets for people coming - from inside your domain (utmp required for + inside_telnet - disallow telnets for people coming + from inside your domain (utmp required for selectivity). jump - disable the 'j' (jump) command. @@ -433,45 +432,45 @@ news_post - disallow USENET News posting. - options_save - disallow saving options in .lynxrc. + options_save - disallow saving options in .lynxrc. - outside_ftp - disallow ftps for people coming from - outside your domain (utmp required for + outside_ftp - disallow ftps for people coming from + outside your domain (utmp required for selectivity). - outside_news - disallow USENET news reading and - posting for people coming from outside your domain - (utmp required for selectivity). This restriction - applies to "news", "nntp", "newspost", and - "newsreply" URLs, but not to "snews", "snewspost", + outside_news - disallow USENET news reading and + posting for people coming from outside your domain + (utmp required for selectivity). This restriction + applies to "news", "nntp", "newspost", and + "newsreply" URLs, but not to "snews", "snewspost", or "snewsreply" in case they are supported. outside_rlogin - disallow rlogins for people coming - from outside your domain (utmp required for + from outside your domain (utmp required for selectivity). outside_telnet - disallow telnets for people coming - from outside your domain (utmp required for + from outside your domain (utmp required for selectivity). print - disallow most print options. - shell - disallow shell escapes and lynxexec or + shell - disallow shell escapes and lynxexec or lynxprog G)oto's. - suspend - disallow Unix Control-Z suspends with + suspend - disallow Unix Control-Z suspends with escape to shell. - telnet_port - disallow specifying a port in telnet + telnet_port - disallow specifying a port in telnet G)oto's. - useragent - disallow modifications of the User- + useragent - disallow modifications of the User- Agent header. -resubmit_posts - toggles forced resubmissions (no-cache) of forms - with method POST when the documents they returned - are sought with the PREV_DOC command or from the + toggles forced resubmissions (no-cache) of forms + with method POST when the documents they returned + are sought with the PREV_DOC command or from the History List. -rlogin @@ -540,6 +539,7 @@ traverse all http links derived from startfile. When used with -crawl, each link that begins with the same string as startfile is output to a file, + intended for indexing. See CRAWL.announce for more information. @@ -567,7 +567,7 @@ security restrictions also are implemented. -verbose - taggles [LINK], [IMAGE] and [INLINE] comments with + toggle [LINK], [IMAGE] and [INLINE] comments with filenames of these images. -version @@ -576,6 +576,11 @@ -vikeys enable vi-like key movement. + -wdebug + enable Waterloo tcp/ip packet debug (print to watt + debugfile). This applies only to DOS versions + compiled with WATTCP or WATT-32. + -width=NUMBER number of columns for formatting of dumps, default is 80. diff --git a/lynx.man b/lynx.man index f3fcc8a4..d85d8858 100644 --- a/lynx.man +++ b/lynx.man @@ -598,7 +598,7 @@ accept only http URLs (for validation). Complete security restrictions also are implemented. .TP .B -verbose -taggles [LINK], [IMAGE] and [INLINE] comments with filenames of these images. +toggle [LINK], [IMAGE] and [INLINE] comments with filenames of these images. .TP .B -version print version information. @@ -606,6 +606,10 @@ print version information. .B -vikeys enable vi-like key movement. .TP +.B -wdebug +enable Waterloo tcp/ip packet debug (print to watt debugfile). +This applies only to DOS versions compiled with WATTCP or WATT-32. +.TP .B -width\fR=\fINUMBER number of columns for formatting of dumps, default is 80. .TP diff --git a/lynx_help/Lynx_users_guide.html b/lynx_help/Lynx_users_guide.html index 2853d578..c7c3c610 100644 --- a/lynx_help/Lynx_users_guide.html +++ b/lynx_help/Lynx_users_guide.html @@ -2057,8 +2057,15 @@ where to further accesses. </ul> <dt><code>options</code> - <dd>can be selected from the following list, where items in - all-caps indicate that a substitution must be made. + <dd>can be selected from the following list, where items in all-caps + indicate that a substitution must be made. Many options are + "toggles", meaning that they will change the default action, + however it was specified. To always set the option on, use the + syntax "-option+", "-option=on", or "-option:on". To always set + the option off, use the syntax "-option-", "-option=off", or + "-option:off". The syntax with the "=" may not work under DOS + because of operating system constraints. Use one of the other + forms in that case. <dl> <dt><code>-</code> <dd>If the argument is only '<code>-</code>' (dash), then Lynx @@ -2528,8 +2535,11 @@ where </dl> <p>No options are required, nor is a startfile argument required. -White space may be substituted for any equal sign ('<em>=</em>') -appearing in the option list above. [<A HREF="#ToC-Invoking">ToC</A>] +White space can be used in place of equal sign separators ('<em>=</em>') +appearing in the option list above. It can not be used in place of the equal +signs in forms like "-option=on" and "-option=off" for simple switches and +toggles, for which "-option" alone (without a value) is valid. +[<A HREF="#ToC-Invoking">ToC</A>] <h2 ID="Environments"><A NAME="Environment"><em>Environment variables used by Lynx</em></A></h2> diff --git a/makefile.in b/makefile.in index d9079b22..28116f50 100644 --- a/makefile.in +++ b/makefile.in @@ -119,6 +119,7 @@ SITE_DEFS = # Your defines here # -DNO_RULES Disables CERN-style access rules (see lynx.cfg). # -DSHORTENED_RBIND For a SOCKSified lynx with the short version of Rbind. # -DSLANG_MBCS_HACK prevent cutoff lines when using UTF8 console (slang only) +# -DUSE_SCROLLBAR supports scrollbar when built with ncurses # # if you are linking to freeWAIS-0.202 or older, you should define this # in SITE_DEFS @@ -317,16 +318,19 @@ install-bin: $(BINDIR) install-man : $(MANDIR) $(INSTALL_DATA) $(srcdir)/lynx.man $(MANDIR)/lynx.1 -install-doc : $(DOCDIR) +install-doc : $(DOCDIR) $(HELPDIR) @echo Copying sample files (cd $(srcdir) && tar cf - C[HO]* PROBLEMS README samples test ) | \ ( cd $(DOCDIR) && tar xf - ) + $(SHELL) -c 'for name in COPYING COPYHEADER; do \ + cd $(HELPDIR) && ( $(LN_S) $(DOCDIR)/$$name . || cp $(DOCDIR)/$$name . );\ + done' # HPUX 'sed' does not seem to like '=' as pattern delimiter. FIX_SED = tr '=' '%' #FIX_SED = cat -install-help : $(DOCDIR) $(HELPDIR) +install-help : $(HELPDIR) (cd $(HELPDIR) && WD=`pwd` && HEAD=`echo $$WD|sed -e 's@/lynx_help$$@@'` && test $$WD != $$HEAD && rm -rf *) @echo Constructing sed-script @ECHO_CC@sed -e '/^#/d' -e '/^$$/d' \ @@ -373,9 +377,6 @@ install-help : $(DOCDIR) $(HELPDIR) $(LIBDIR)/lynx.tmp >$(LIBDIR)/lynx.cfg chmod 644 $(LIBDIR)/lynx.cfg -rm -f $(LIBDIR)/lynx.tmp - $(SHELL) -c 'for name in COPYING COPYHEADER; do \ - cd $(DOCDIR) && ( $(LN_S) $$name $(HELPDIR)/ || cp $$name $(HELPDIR)/ );\ - done' LYHelp.h : LYHelp.hin @echo Constructing sed-script diff --git a/src/GridText.c b/src/GridText.c index 54631f8a..1d4092a1 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -137,6 +137,13 @@ PUBLIC int LYCacheSource = SOURCE_CACHE_NONE; PUBLIC BOOLEAN from_source_cache = FALSE; /* mutable */ #endif +#ifdef USE_SCROLLBAR +PUBLIC int LYsb = FALSE; +PUBLIC int LYsb_arrow = TRUE; +PUBLIC int LYsb_begin = -1; +PUBLIC int LYsb_end = -1; +#endif + #if defined(USE_COLOR_STYLE) #define MAX_STYLES_ON_LINE 64 @@ -298,6 +305,7 @@ static int justified_text_map[MAX_LINE]; /* this is a map - for each index i it tells to which position j=justified_text_map[i] in justified text i-th character is mapped - it's used for anchor positions fixup and for color style's positions adjustment. */ +static BOOL have_raw_nbsps = FALSE; PUBLIC void ht_justify_cleanup NOARGS { @@ -313,6 +321,7 @@ PUBLIC void ht_justify_cleanup NOARGS last_anchor_of_previous_line = NULL; this_line_was_splitted = FALSE; in_DT = FALSE; + have_raw_nbsps = FALSE; } PUBLIC void mark_justify_start_position ARGS1(void*,text) @@ -1239,6 +1248,139 @@ PRIVATE void display_title ARGS1( return; } +/* Output the scrollbar +** --------------------- +*/ +#ifdef USE_SCROLLBAR +PRIVATE void display_scrollbar ARGS1( + HText *, text) +{ + int i; + int h = display_lines - 2 * (LYsb_arrow!=0); /* Height of the scrollbar */ + int off = (LYsb_arrow != 0); /* Start of the scrollbar */ + int top_skip, bot_skip, sh; + + LYsb_begin = LYsb_end = -1; + if (!LYsb || !text || h <= 2 + || (text->Lines + 1) <= display_lines) + return; + + /* Each cell of scrollbar represents text->Lines/h lines of text. */ + /* Always smaller than h */ + sh = (display_lines*h + text->Lines/2)/(text->Lines + 1); + if (sh <= 0) + sh = 1; + if (sh >= h) + sh = h - 1; + + /* Always non-zero if not top, which is text->top_of_screen != 0 . */ + top_skip = (text->top_of_screen * h + text->Lines)/(text->Lines + 1); + if (top_skip >= h) + top_skip = h - 1; + + /* End happens when + (text->Lines + 1 - (text->top_of_screen + display_lines - 1)) + is either 0 or 1. */ + bot_skip = + (text->Lines + 1 - (text->top_of_screen + display_lines - 1) - 1); + if (bot_skip < 0) + bot_skip = 0; + bot_skip = (bot_skip * h + text->Lines)/(text->Lines + 1); + + /* Now make sure the height is always sh unless top_skip==bot_skip==1 */ + if (top_skip + bot_skip + sh != h && !(top_skip == 1 && bot_skip == 1)) { + /* One which is smaller takes precedence. */ + if (top_skip < bot_skip) { + int t = h - top_skip - sh; + + if (t < top_skip) + bot_skip = top_skip; + else + bot_skip = t; + } else { + int t = h - bot_skip - sh; + + if (t < bot_skip) + top_skip = bot_skip; + else + top_skip = t; + } + } + /* Ensure the bar is visible if h >= 3 */ + if (top_skip + bot_skip >= h) + bot_skip = h - top_skip; + if (top_skip + bot_skip == h && h >= 3) { + if (bot_skip > 1) + bot_skip--; + else + top_skip--; + } + LYsb_begin = top_skip; + LYsb_end = h - bot_skip; + + if (LYsb_arrow) { +#ifdef USE_COLOR_STYLE + int s = top_skip ? s_sb_aa : s_sb_naa; + + if (last_colorattr_ptr > 0) { + LynxChangeStyle(s, STACK_ON, 0); + } else { + LynxChangeStyle(s, ABS_ON, 0); + } +#endif /* USE_COLOR_STYLE */ + move(1, LYcols - 1); + addch(ACS_UARROW); +#ifdef USE_COLOR_STYLE + LynxChangeStyle(s, STACK_OFF, 0); +#endif /* USE_COLOR_STYLE */ + } +#ifdef USE_COLOR_STYLE + if (last_colorattr_ptr > 0) { + LynxChangeStyle(s_sb_bg, STACK_ON, 0); + } else { + LynxChangeStyle(s_sb_bg, ABS_ON, 0); + } +#endif /* USE_COLOR_STYLE */ + + for (i=1; i <= h; i++) { +#ifdef USE_COLOR_STYLE + if (i-1 <= top_skip && i > top_skip) + LynxChangeStyle(s_sb_bar, STACK_ON, 0); + if (i-1 <= h - bot_skip && i > h - bot_skip) + LynxChangeStyle(s_sb_bar, STACK_OFF, 0); +#endif /* USE_COLOR_STYLE */ + move(i + off, LYcols - 1); + if (i > top_skip && i <= h - bot_skip) + addch(ACS_BLOCK); + else + addch(ACS_CKBOARD); + } +#ifdef USE_COLOR_STYLE + LynxChangeStyle(s_sb_bg, STACK_OFF, 0); +#endif /* USE_COLOR_STYLE */ + + if (LYsb_arrow) { +#ifdef USE_COLOR_STYLE + int s = bot_skip ? s_sb_aa : s_sb_naa; + + if (last_colorattr_ptr > 0) { + LynxChangeStyle(s, STACK_ON, 0); + } else { + LynxChangeStyle(s, ABS_ON, 0); + } +#endif /* USE_COLOR_STYLE */ + move(h + 2, LYcols - 1); + addch(ACS_DARROW); +#ifdef USE_COLOR_STYLE + LynxChangeStyle(s, STACK_OFF, 0); +#endif /* USE_COLOR_STYLE */ + } + return; +} +#else +#define display_scrollbar(text) /*nothing*/ +#endif /* USE_SCROLLBAR */ + /* Output a page ** ------------- */ @@ -1811,6 +1953,7 @@ PRIVATE void display_page ARGS3( */ addstr("\n Document is empty"); } + display_scrollbar(text); #ifdef DISP_PARTIAL if (display_partial && display_flag && @@ -1825,7 +1968,7 @@ PRIVATE void display_page ARGS3( } #endif /* DISP_PARTIAL */ - if (HTCJK != NOCJK || text->T.output_utf8) { + if (HTCJK != NOCJK) { /* * For non-multibyte curses. */ @@ -2536,23 +2679,23 @@ PRIVATE void split_line ARGS2( continue; } if (text->T.output_utf8 && !isascii(c)) { - int utf_extra = 0; - if ((c & 0xe0) == 0xc0) { - utf_extra = 1; - } else if ((c & 0xf0) == 0xe0) { - utf_extra = 2; - } else if ((c & 0xf8) == 0xf0) { - utf_extra = 3; - } else if ((c & 0xfc) == 0xf8) { - utf_extra = 4; - } else if ((c & 0xfe) == 0xfc) { - utf_extra = 5; - } else - utf_extra = 0; - if ( (int) strlen(jp+1) < utf_extra) - utf_extra = 0; - r->byte_len += utf_extra; - jp += utf_extra; + int utf_extra = 0; + if ((c & 0xe0) == 0xc0) { + utf_extra = 1; + } else if ((c & 0xf0) == 0xe0) { + utf_extra = 2; + } else if ((c & 0xf8) == 0xf0) { + utf_extra = 3; + } else if ((c & 0xfc) == 0xf8) { + utf_extra = 4; + } else if ((c & 0xfe) == 0xfc) { + utf_extra = 5; + } else + utf_extra = 0; + if ( (int) strlen(jp+1) < utf_extra) + utf_extra = 0; + r->byte_len += utf_extra; + jp += utf_extra; } } total_byte_len += r->byte_len; @@ -2577,7 +2720,7 @@ PRIVATE void split_line ARGS2( r_ = spare % (ht_num_runs-1); m = justified_text_map; - for(jp=previous->data,i=0;i<justify_start_position;++i) { + for(jp = previous->data, i = 0; i < justify_start_position; ++i) { *m++ = i; *jdata++ = ( *prevdata == HT_NON_BREAK_SPACE ? ' ' : *prevdata); ++prevdata; @@ -2640,7 +2783,7 @@ PRIVATE void split_line ARGS2( #endif /* we have to fix anchors*/ { - /*a2 is the last anchor on the line preceeding 'previous'*/ + /*a2 is the last anchor on the line preceding 'previous'*/ TextAnchor* a2 = last_anchor_of_previous_line; if (!a2) @@ -2750,7 +2893,7 @@ PRIVATE void split_line ARGS2( char* p; /* it was permitted to justify line, but this function was called - * to end paragraph - we must subsitute HT_NON_BREAK_SPACEs with + * to end paragraph - we must substitute HT_NON_BREAK_SPACEs with * spaces in previous line */ if (line->size) { @@ -2760,9 +2903,22 @@ PRIVATE void split_line ARGS2( for (p=previous->data;*p;++p) if (*p == HT_NON_BREAK_SPACE) *p = ' '; + } else if (have_raw_nbsps) { + /* this is very rare case, that can happen in forms placed in + table cells*/ + int i; + + for (i = 0; i< previous->size; ++i) + if (previous->data[i] == HT_NON_BREAK_SPACE) + previous->data[i] = ' '; + + /*next line won't be justified, so substitute nbsps in it too */ + for (i = 0; i< line->size; ++i) + if (line->data[i] == HT_NON_BREAK_SPACE) + line->data[i] = ' '; } - /* HT_NON_BREAK_SPACEs were subsituted with spaces in + /* else HT_NON_BREAK_SPACEs were substituted with spaces in HText_appendCharacter */ { /* keep maintaining 'last_anchor_of_previous_line' */ @@ -2779,12 +2935,12 @@ PRIVATE void split_line ARGS2( last_anchor_of_previous_line = a2, a2 = a2->next); } } - /* cleanup */ can_justify_this_line = TRUE; justify_start_position = 0; this_line_was_splitted = FALSE; -#endif + have_raw_nbsps = FALSE; +#endif /* EXP_JUSTIFY_ELTS */ } /* split_line */ @@ -3434,6 +3590,11 @@ check_IgnoreExcess: #endif ) ch = ' '; +#ifdef EXP_JUSTIFY_ELTS + else + have_raw_nbsps = TRUE; +#endif + /* we leave raw HT_NON_BREAK_SPACE otherwise (we'll substitute it later) */ if (ch & 0x80) diff --git a/src/HTAlert.c b/src/HTAlert.c index 2200a58a..908e52c5 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -22,7 +22,7 @@ #include <LYLeaks.h> -#if _WIN_CC +#if defined(WIN_EX) && defined(UNUSED_CODE) #include <HTParse.h> #endif @@ -110,7 +110,7 @@ PUBLIC void HTUserMsg2 ARGS2( } } -#ifdef WIN_EX /* 1997/10/28 (Tue) 17:19:43 */ +#if defined(WIN_EX) && defined(UNUSED_CODE) /* 1997/10/28 (Tue) 17:19:43 */ #define MAX_LEN 512 diff --git a/src/HTFWriter.c b/src/HTFWriter.c index 68d4b1de..14edbb2a 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -13,8 +13,11 @@ #include <HTFWriter.h> #include <HTSaveToFile.h> -#if _WIN_CC +#if WIN_EX #include <HTParse.h> +#endif + +#if _WIN_CC extern int exec_command(char * cmd, int wait_flag); /* xsystem.c */ #endif diff --git a/src/LYCookie.c b/src/LYCookie.c index ea5bd4d3..d1717004 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -611,8 +611,8 @@ PRIVATE void store_cookie ARGS3( ** include in a Cookie: request header. - AK & FM */ PRIVATE char * scan_cookie_sublist ARGS6( - CONST char *, hostname, - CONST char *, path, + char *, hostname, + char *, path, int, port, HTList *, sublist, char *, header, @@ -630,7 +630,7 @@ PRIVATE char * scan_cookie_sublist ARGS6( next = hl->next; if ((co) && /* speed-up host_matches() and limit trace output */ - (LYstrstr((char *)hostname, co->domain) != NULL)) + (LYstrstr(hostname, co->domain) != NULL)) { CTRACE(tfp, "Checking cookie %p %s=%s\n", hl, @@ -1952,8 +1952,8 @@ PUBLIC void LYSetCookie ARGS3( ** if needed. - AK & FM */ PUBLIC char * LYCookie ARGS4( - CONST char *, hostname, - CONST char *, path, + char *, hostname, + char *, path, int, port, BOOL, secure) { diff --git a/src/LYCookie.h b/src/LYCookie.h index 5e599191..7767003a 100644 --- a/src/LYCookie.h +++ b/src/LYCookie.h @@ -32,8 +32,8 @@ extern void LYSetCookie PARAMS(( CONST char * SetCookie2, CONST char * address)); extern char *LYCookie PARAMS(( - CONST char * hostname, - CONST char * partialpath, + char * hostname, + char * partialpath, int port, BOOL secure)); extern void LYStoreCookies PARAMS(( diff --git a/src/LYDownload.c b/src/LYDownload.c index 78b1a4cb..7501d886 100644 --- a/src/LYDownload.c +++ b/src/LYDownload.c @@ -248,7 +248,7 @@ check_recall: /* * See if we can write to it. */ - CTRACE(tfp, "LYDownload: filename is %s", buffer); + CTRACE(tfp, "LYDownload: filename is %s\n", buffer); if ((fp = fopen(buffer, "w")) != NULL) { fclose(fp); diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 5f3c0da9..22a828dd 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -442,4 +442,12 @@ extern void cygwin_conv_to_full_posix_path(char *dos, char *posix); extern int setmode(int handle, int amode); #endif +#ifdef USE_SCROLLBAR +/* GridText.c */ +extern int LYsb; +extern int LYsb_arrow; +extern int LYsb_begin; +extern int LYsb_end; +#endif + #endif /* LYGLOBALDEFS_H */ diff --git a/src/LYHash.h b/src/LYHash.h index 7945051c..793eebbe 100644 --- a/src/LYHash.h +++ b/src/LYHash.h @@ -45,6 +45,9 @@ extern int hash_table[CSHASHSIZE]; /* 32K should be big enough */ extern int s_alink, s_a, s_status, s_label, s_value, s_high, s_normal, s_alert, s_title, +#ifdef USE_SCROLLBAR + s_sb_bar, s_sb_bg, s_sb_aa, s_sb_naa, +#endif s_whereis; #define CACHEW 128 #define CACHEH 64 diff --git a/src/LYMain.c b/src/LYMain.c index b2a82c6b..83e3cbcf 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -92,6 +92,10 @@ PUBLIC char *syslog_txt = NULL; /* syslog arb text for session */ PUBLIC char *LYCSwingPath = NULL; #endif /* VMS */ +#if HAVE_CUSERID && !defined(_XOPEN_SOURCE) +extern char *cuserid(); /* workaround for Redhat 6.0 */ +#endif + #ifdef DIRED_SUPPORT PUBLIC BOOLEAN lynx_edit_mode = FALSE; PUBLIC BOOLEAN no_dired_support = FALSE; @@ -197,7 +201,7 @@ PUBLIC BOOLEAN telnet_ok = TRUE; PUBLIC BOOLEAN news_ok = TRUE; #endif PUBLIC BOOLEAN rlogin_ok = TRUE; -PUBLIC BOOLEAN long_url_ok = TRUE; +PUBLIC BOOLEAN long_url_ok = FALSE; PUBLIC BOOLEAN ftp_ok = TRUE; PUBLIC BOOLEAN system_editor = FALSE; @@ -276,6 +280,9 @@ PUBLIC BOOLEAN local_host_only = FALSE; PUBLIC BOOLEAN override_no_download = FALSE; PUBLIC BOOLEAN show_dotfiles = FALSE; /* From rcfile if no_dotfiles is false */ PUBLIC BOOLEAN LYforce_HTML_mode = FALSE; +#ifdef __DJGPP__ +PUBLIC BOOLEAN watt_debug = FALSE; /* WATT-32 debugging */ +#endif /* __DJGPP__ */ #ifdef WIN_EX #undef SYSTEM_MAIL @@ -728,7 +735,7 @@ PRIVATE int argcmp ARGS2( { if (str[0] == '-' && str[1] == '-' ) ++str; #if !OPTNAME_ALLOW_DASHES - return strcmp(str,what); + return strcmp(str, what); #else ++str; ++what; /*skip leading dash in both strings*/ { @@ -779,7 +786,7 @@ PUBLIC int main ARGS2( int err; WORD wVerReq; - wVerReq = MAKEWORD(1,1); + wVerReq = MAKEWORD(1, 1); err = WSAStartup(wVerReq, &WSAData); if (err != 0) @@ -823,10 +830,7 @@ PUBLIC int main ARGS2( init_ctrl_break[0] = 1; } atexit(reset_break); - dbug_init(); - sock_init(); - __system_flags = 0x501D; -#endif +#endif /* __DJGPP__ */ /* * To prevent corrupting binary data on DOS, MS-WINDOWS or OS/2 @@ -1078,7 +1082,8 @@ PUBLIC int main ARGS2( socks_flag = FALSE; #endif /* SOCKS */ } else if (argncmp(argv[i], "-cfg") == 0) { - if ((cp=strchr(argv[i],'=')) != NULL) + if (((cp = strchr(argv[i], '=')) != NULL) + || ((cp = strchr(argv[i], ':')) != NULL)) StrAllocCopy(lynx_cfg_file, cp+1); else { StrAllocCopy(lynx_cfg_file, argv[i+1]); @@ -1087,7 +1092,7 @@ PUBLIC int main ARGS2( #if defined(USE_HASH) } else if (argncmp(argv[i], "-lss") == 0) { - if ((cp=strchr(argv[i],'=')) != NULL) + if ((cp=strchr(argv[i], '=')) != NULL) StrAllocCopy(lynx_lss_file, cp+1); else { StrAllocCopy(lynx_lss_file, argv[i+1]); @@ -1152,7 +1157,7 @@ PUBLIC int main ARGS2( socks_flag = FALSE; #endif /* SOCKS */ } else if (argncmp(buf, "-cfg") == 0) { - if ((cp = strchr(buf,'=')) != NULL) { + if ((cp = strchr(buf, '=')) != NULL) { StrAllocCopy(lynx_cfg_file, cp+1); } else { cp = LYSkipNonBlanks(buf); @@ -1162,7 +1167,7 @@ PUBLIC int main ARGS2( } #if defined(USE_HASH) } else if (argncmp(buf, "-lss") == 0) { - if ((cp = strchr(buf,'=')) != NULL) { + if ((cp = strchr(buf, '=')) != NULL) { StrAllocCopy(lynx_lss_file, cp+1); } else { cp = LYSkipNonBlanks(buf); @@ -1287,7 +1292,7 @@ PUBLIC int main ARGS2( * a TRACE log NOW. - FM */ if (!LYValidate && !LYRestricted && - strlen((char *)ANONYMOUS_USER) > 0 && + strlen(ANONYMOUS_USER) > 0 && #if defined (VMS) || defined (NOUSERS) !strcasecomp(((char *)getenv("USER")==NULL ? " " : getenv("USER")), ANONYMOUS_USER) @@ -1817,7 +1822,7 @@ PUBLIC int main ARGS2( * Block Control-Z suspending if requested. - FM */ if (no_suspend) - (void) signal(SIGTSTP,SIG_IGN); + (void) signal(SIGTSTP, SIG_IGN); #endif /* SIGTSTP */ /* @@ -1904,7 +1909,7 @@ PUBLIC int main ARGS2( ftp_ok = !no_inside_ftp && !no_outside_ftp && ftp_ok; rlogin_ok = !no_inside_rlogin && !no_outside_rlogin && rlogin_ok; #else - CTRACE(tfp,"LYMain: User in Local domain\n"); + CTRACE(tfp, "LYMain: User in Local domain\n"); telnet_ok = !no_inside_telnet && telnet_ok; #ifndef DISABLE_NEWS news_ok = !no_inside_news && news_ok; @@ -1913,7 +1918,7 @@ PUBLIC int main ARGS2( rlogin_ok = !no_inside_rlogin && rlogin_ok; #endif /* !HAVE_UTMP || VMS */ } else { - CTRACE(tfp,"LYMain: User in REMOTE domain\n"); + CTRACE(tfp, "LYMain: User in REMOTE domain\n"); telnet_ok = !no_outside_telnet && telnet_ok; #ifndef DISABLE_NEWS news_ok = !no_outside_news && news_ok; @@ -1939,6 +1944,20 @@ PUBLIC int main ARGS2( StrAllocCopy(MBM_A_subdescript[0], MULTIBOOKMARKS_DEFAULT); } +#if defined (__DJGPP__) + if (watt_debug) + dbug_init(); + sock_init(); + + __system_flags = + __system_emulate_chdir | /* handle `cd' internally */ + __system_handle_null_commands | /* ignore cmds with no effect */ + __system_allow_long_cmds | /* handle commands > 126 chars */ + __system_use_shell | /* use $SHELL if set */ + __system_allow_multiple_cmds | /* allow `cmd1; cmd2; ...' */ + __system_redirect; /* redirect internally */ +#endif /* __DJGPP__ */ + /* * Here's where we do all the work. */ @@ -1964,7 +1983,7 @@ PUBLIC int main ARGS2( !crawl && /* For -crawl it has already been done! */ (keypad_mode == LINKS_ARE_NUMBERED || keypad_mode == LINKS_AND_FIELDS_ARE_NUMBERED)) - printlist(stdout,FALSE); + printlist(stdout, FALSE); #ifdef EXP_PERSISTENT_COOKIES /* * We want to save cookies picked up when in immediate dump @@ -3242,12 +3261,22 @@ with the PREV_DOC command or from the History List" "rlogin", UNSET_ARG, &rlogin_ok, "disable rlogins" ), +#ifdef USE_SCROLLBAR + PARSE_SET( + "scrollbar", TOGGLE_ARG, &LYsb, + "toggles showing scrollbar (requires color styles)" + ), + PARSE_SET( + "scrollbar_arrow", TOGGLE_ARG, &LYsb_arrow, + "toggles showing arrows at ends of the scrollbar" + ), +#endif PARSE_FUN( "selective", FUNCTION_ARG, selective_fun, "require .www_browsable files to browse directories" ), PARSE_SET( - "short_url", UNSET_ARG, &long_url_ok, + "short_url", SET_ARG, &long_url_ok, "enables examination of beginning and end of long URL in status line" ), #ifdef SH_EX @@ -3351,6 +3380,12 @@ treated '>' as a co-terminator for double-quotes and tags" "vikeys", SET_ARG, &vi_keys, "enable vi-like key movement" ), +#ifdef __DJGPP__ + PARSE_SET( + "wdebug", TOGGLE_ARG, &watt_debug, + "enables Waterloo tcp/ip packet debug. Prints to watt debugfile" + ), +#endif /* __DJGPP__ */ PARSE_FUN( "width", NEED_FUNCTION_ARG, width_fun, "=NUMBER\nscreen width for formatting of dumps (default is 80)" @@ -3485,6 +3520,7 @@ static int arg_eqs_parse ARGS3( if (*a == 0) { switch (*b) { case '=': + case ':': *c = b + 1; return 1; case '-': /* FALLTHRU */ diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 3de3a451..040159a7 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -68,32 +68,30 @@ PUBLIC char *str_kcode(HTkcode code) static char buff[8]; if (current_char_set == CHARSET_TRANS) { - p = "THRU"; + p = "THRU"; + } else if (!LYRawMode) { + p = "RAW"; } else { - if (!LYRawMode) { - p = "RAW"; - } else { - switch (code) { - case NOKANJI: - p = "AUTO"; - break; + switch (code) { + case NOKANJI: + p = "AUTO"; + break; - case EUC: - p = "EUC+"; - break; + case EUC: + p = "EUC+"; + break; - case SJIS: - p = "SJIS"; - break; + case SJIS: + p = "SJIS"; + break; - case JIS: - p = " JIS"; - break; + case JIS: + p = " JIS"; + break; - default: - p = " ???"; - break; - } + default: + p = " ???"; + break; } } @@ -121,7 +119,10 @@ PRIVATE void set_ws_title(char * str) } #endif -/* 1998/10/30 (Fri) 10:06:47 */ +#endif /* CJK_EX */ + + +#ifdef SH_EX /* 1998/10/30 (Fri) 10:06:47 */ #define NOT_EQU 1 @@ -400,6 +401,93 @@ PRIVATE int find_link_near_col ARGS2( } /* + * This is a special feature to traverse every http link derived from startfile + * and check for errors or create crawl output files. Only URL's that begin + * with "traversal_host" are searched - this keeps the search from crossing to + * other servers (a feature, not a bug!). + */ +PRIVATE int DoTraversal ARGS2( + int, c, + BOOLEAN *, crawl_ok) +{ + BOOLEAN rlink_rejected = FALSE; + BOOLEAN rlink_exists; + BOOLEAN rlink_allowed; + + rlink_exists = (nlinks > 0 && + links[curdoc.link].type != WWW_FORM_LINK_TYPE && + links[curdoc.link].lname != NULL); + + if (rlink_exists) { + rlink_rejected = lookup_reject(links[curdoc.link].lname); + if (!rlink_rejected && + traversal_host && + links[curdoc.link].lname) { + if (strncmp(links[curdoc.link].lname, "LYNXIMGMAP:", 11)) { + rlink_allowed = !strncmp(traversal_host, + links[curdoc.link].lname, + strlen(traversal_host)); + } else { + rlink_allowed = !strncmp(traversal_host, + links[curdoc.link].lname + 11, + strlen(traversal_host)); + } + } else { + rlink_allowed = FALSE; + } + } else { + rlink_allowed = FALSE; + } + if (rlink_exists && rlink_allowed) { + if (lookup(links[curdoc.link].lname)) { + if (more_links || + (curdoc.link > -1 && curdoc.link < nlinks -1)) + c= DNARROW; + else { + if (STREQ(curdoc.title,"Entry into main screen") || + (nhist <= 0 )) { + if (!dump_output_immediately) { + cleanup(); + exit_immediately(-1); + } + return(-1); + } + c = LTARROW; + } + } else { + StrAllocCopy(traversal_link_to_add, + links[curdoc.link].lname); + if (strncmp(traversal_link_to_add, "LYNXIMGMAP:", 11)) + *crawl_ok = TRUE; + c = RTARROW; + } + } else { /* no good right link, so only down and left arrow ok*/ + if (rlink_exists /* && !rlink_rejected */) + /* uncomment in previous line to avoid duplicates - kw */ + add_to_reject_list(links[curdoc.link].lname); + if (more_links || + (curdoc.link > -1 && curdoc.link < nlinks-1)) + c = DNARROW; + else { + /* + * curdoc.title doesn't always work, so + * bail out if the history list is empty. + */ + if (STREQ(curdoc.title,"Entry into main screen") || + (nhist <= 0 )) { + if (!dump_output_immediately) { + cleanup(); + exit_immediately(-1); + } + return(-1); + } + c = LTARROW; + } + } /* right link not NULL or link to another site*/ + return c; +} + +/* * Here's where we do all the work. * mainloop is basically just a big switch dependent on the users input. * I have tried to offload most of the work done here to procedures to @@ -434,8 +522,6 @@ int mainloop NOARGS BOOLEAN force_load = FALSE; BOOLEAN try_internal = FALSE; BOOLEAN crawl_ok = FALSE; - BOOLEAN rlink_exists; - BOOLEAN rlink_allowed; BOOLEAN vi_keys_flag = vi_keys; BOOLEAN emacs_keys_flag = emacs_keys; BOOLEAN trace_mode_flag = FALSE; @@ -826,11 +912,11 @@ try_again: mail_owner = owner_address + 7; } /* - * Email a bad link message to the owner of - * the document, or to ALERTMAIL if defined, - * but NOT to lynx-dev (it is rejected in - * mailmsg). - FM, kw - */ + * Email a bad link message to the owner of + * the document, or to ALERTMAIL if defined, + * but NOT to lynx-dev (it is rejected in + * mailmsg). - FM, kw + */ #ifndef ALERTMAIL if (mail_owner) #endif @@ -1604,7 +1690,7 @@ try_again: } -#if defined(SH_EX) /* 1997/10/08 (Wed) 14:52:06 */ +#if defined(CJK_EX) /* 1997/10/08 (Wed) 14:52:06 */ if (nlinks > 0) { char *p = "LYNX (unknown link type)"; @@ -1670,7 +1756,7 @@ try_again: set_ws_title(HTUnEscape(temp_buff)); } } -#endif /* SH_EX */ +#endif /* CJK_EX */ /* * Report unread or new mail, if appropriate. @@ -1934,77 +2020,8 @@ new_keyboard_input: * back through the getch() loop. */ if (traversal) { - /* - * This is a special feature to traverse every http link - * derived from startfile and check for errors or create - * crawl output files. Only URL's that begin with - * "traversal_host" are searched - this keeps the search - * from crossing to other servers (a feature, not a bug!). - */ - BOOLEAN rlink_rejected = FALSE; - rlink_exists = (nlinks > 0 && - links[curdoc.link].type != WWW_FORM_LINK_TYPE && - links[curdoc.link].lname != NULL); - if (rlink_exists) { - rlink_rejected = lookup_reject(links[curdoc.link].lname); - rlink_allowed = - (!rlink_rejected && - traversal_host && links[curdoc.link].lname && - !strncmp(traversal_host, - (strncmp(links[curdoc.link].lname, - "LYNXIMGMAP:", 11) - ? - links[curdoc.link].lname : (links[curdoc.link].lname + 11)), - strlen(traversal_host))); - } else { - rlink_allowed = FALSE; - } - if (rlink_exists && rlink_allowed) { - if (lookup(links[curdoc.link].lname)) { - if (more_links || - (curdoc.link > -1 && curdoc.link < nlinks -1)) - c= DNARROW; - else { - if (STREQ(curdoc.title,"Entry into main screen") || - (nhist <= 0 )) { - if (!dump_output_immediately) { - cleanup(); - exit_immediately(-1); - } - return(-1); - } - c = LTARROW; - } - } else { - StrAllocCopy(traversal_link_to_add, - links[curdoc.link].lname); - if (strncmp(traversal_link_to_add, "LYNXIMGMAP:", 11)) - crawl_ok = TRUE; - c = RTARROW; - } - } else { /* no good right link, so only down and left arrow ok*/ - if (rlink_exists /* && !rlink_rejected */) - /* uncomment in previous line to avoid duplicates - kw */ - add_to_reject_list(links[curdoc.link].lname); - if (more_links || - (curdoc.link > -1 && curdoc.link < nlinks-1)) - c = DNARROW; - else { - /* - * curdoc.title doesn't always work, so - * bail out if the history list is empty. - */ - if (STREQ(curdoc.title,"Entry into main screen") || - (nhist <= 0 )) { - if (!dump_output_immediately) { - cleanup(); - exit_immediately(-1); - } - return(-1); - } - c = LTARROW; - } - } /* right link not NULL or link to another site*/ + if ((c = DoTraversal(c, &crawl_ok)) < 0) + return (-1); } /* traversal */ #ifdef WIN_EX @@ -2314,22 +2331,22 @@ new_cmd: /* #ifdef SOURCE_CACHE if (HTreparse_document()) { - /* - * These normally get cleaned up after getfile() returns; - * since we're not calling getfile(), we have to clean them - * up ourselves. -dsb - */ - HTOutputFormat = WWW_PRESENT; + /* + * These normally get cleaned up after getfile() returns; + * since we're not calling getfile(), we have to clean them + * up ourselves. -dsb + */ + HTOutputFormat = WWW_PRESENT; #ifdef USE_PSRC - if (psrc_view) - HTMark_asSource(); - psrc_view = FALSE; + if (psrc_view) + HTMark_asSource(); + psrc_view = FALSE; #endif - FREE(ownerS_address); /* not used with source_cache */ - LYUCPopAssumed(); /* probably a right place here */ - HTMLSetCharacterHandling(current_char_set); /* restore now */ + FREE(ownerS_address); /* not used with source_cache */ + LYUCPopAssumed(); /* probably a right place here */ + HTMLSetCharacterHandling(current_char_set); /* restore now */ - break; + break; } #endif @@ -2726,7 +2743,7 @@ new_cmd: /* } break; -#if defined(SH_EX) && defined(DOSPATH) /*1997/12/22 (Mon) 09:28:56 */ +#if defined(WIN_EX) && defined(SH_EX) /*1997/12/22 (Mon) 09:28:56 */ case LYK_TO_CLIPBOARD: /* ^S */ { if (put_clip(links[curdoc.link].lname) == 0) { @@ -6883,7 +6900,7 @@ PRIVATE void status_link ARGS3( BOOLEAN, show_indx) { #define MAX_STATUS (LYcols - 2) -#define MIN_STATUS MAX_STATUS / 2 +#define MIN_STATUS 0 char format[MAX_LINE]; int prefix; int length; @@ -6903,41 +6920,40 @@ PRIVATE void status_link ARGS3( if ((length + prefix > MAX_STATUS) && long_url_ok) { char *buf = NULL; - int j; - int k; - int cut_position; - int link_position; + int cut_from_pos; + int cut_to_pos; + int n; StrAllocCopy(buf, curlink_name); - - /* Scan to find the final leaf of the url, put it in 'k'. - * Ignore trailing '/'. + /* + * Scan to find the final leaf of the URL. + * Ignore trailing '/'. */ - for (j = length; (j > 0) && buf[j] != '/'; --j) - ; - if (j >= (length - 3)) { - for (k = j - 1; (k > 0) && buf[k] != '/'; --k) - ; - } else { - k = j; - } - - /* We assume that one can recognize the link from at least - * MIN_STATUS characters. + for (cut_to_pos = length - 2; + (cut_to_pos > 0) && (buf[cut_to_pos] != '/'); + cut_to_pos--) + ; + /* + * Jump back to the next leaf to remove. */ - cut_position = MAX_STATUS - prefix - (length - k); - if (cut_position < MIN_STATUS){ - cut_position = MIN_STATUS; - link_position = length - MIN_STATUS + 3; - } else { - link_position = k; + for (cut_from_pos = cut_to_pos - 4; + (cut_from_pos > 0) && ((buf[cut_from_pos] != '/') + || (prefix + cut_from_pos + 4 + (length - cut_to_pos) >= MAX_STATUS)); + cut_from_pos--) + ; + /* + * Replace some leaves to '...', if possible, and put the + * final leaf at the end. We assume that one can recognize + * the link from at least MIN_STATUS characters. + */ + if (cut_from_pos > MIN_STATUS) { + for (n = 1; n <= 3; n++) + buf[cut_from_pos + n] = '.'; + for (n = 0; cut_to_pos + n <= length; n++) + buf[cut_from_pos + 4 + n] = buf[cut_to_pos + n]; } - for (j = 0; j < 3; j++) - buf[cut_position++] = '_'; - if (cut_position < link_position) - while ((buf[cut_position++] = buf[link_position++]) != 0) - ; _user_message(format, buf); + CTRACE(tfp,"lastline = %s\n",buf); /* don't forget to erase me */ FREE(buf); } else { /* show (possibly truncated) url */ _user_message(format, curlink_name); diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 3a765e6c..53784dae 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -1211,6 +1211,10 @@ static Config_Type Config_Table [] = #endif /* NO_RULES */ PARSE_STR("save_space", CONF_STR, &lynx_save_space), PARSE_SET("scan_for_buried_news_refs", CONF_BOOL, &scan_for_buried_news_references), +#ifdef USE_SCROLLBAR + PARSE_SET("scrollbar", CONF_BOOL, &LYsb), + PARSE_SET("scrollbar_arrow", CONF_BOOL, &LYsb_arrow), +#endif PARSE_SET("seek_frag_area_in_cur", CONF_BOOL, &LYSeekFragAREAinCur), PARSE_SET("seek_frag_map_in_cur", CONF_BOOL, &LYSeekFragMAPinCur), PARSE_SET("set_cookies", CONF_BOOL, &LYSetCookies), diff --git a/src/LYStrings.c b/src/LYStrings.c index db33de8f..1d7976bf 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -305,6 +305,22 @@ PRIVATE int set_clicked_link ARGS4( if (x < left) c = LTARROW; else if (x > right) c = '\b'; else c = PGUP; +#ifdef USE_SCROLLBAR + } else if (x == LYcols - 1 && LYsb && LYsb_begin >= 0) { + int h = display_lines - 2*(LYsb_arrow != 0); + + mouse_link = -2; + y -= 1 + (LYsb_arrow != 0); + if (y < 0) + return INSERT_KEY; + if (y >= h) + return REMOVE_KEY; + if (y < LYsb_begin) + return PGUP; + if (y >= LYsb_end) + return PGDOWN; + mouse_link = -1; /* No action in edit fields */ +#endif } else { int mouse_err = 4, /* subjctv-dist better than this for approx stuff */ cur_err; @@ -1837,6 +1853,10 @@ re_read: c = END_KEY; else if (c == PGUP) c = HOME; + else if (c == REMOVE_KEY) + c = END_KEY; + else if (c == INSERT_KEY) + c = HOME; else if (c == RTARROW) c = END_KEY; else if (c == LTARROW && code == FOR_PROMPT) diff --git a/src/LYStyle.c b/src/LYStyle.c index 75bfeccb..4943ca7f 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,v 1.23 1999/07/30 16:06:54 tom Exp $ + * @Id: LYStyle.c 1.31 Fri, 13 Aug 1999 07:27:27 -0600 dickey @ */ #include <HTUtils.h> #include <HTML.h> @@ -64,6 +64,10 @@ static char *Mono_Strings[7] = PUBLIC int s_alink = NOSTYLE, s_a = NOSTYLE, s_status = NOSTYLE, s_label = NOSTYLE, s_value = NOSTYLE, s_high = NOSTYLE, s_normal = NOSTYLE, s_alert = NOSTYLE, s_title = NOSTYLE, +#ifdef USE_SCROLLBAR + s_sb_bar = NOSTYLE, s_sb_bg = NOSTYLE, + s_sb_aa = NOSTYLE, s_sb_naa = NOSTYLE, +#endif s_whereis= NOSTYLE; /* start somewhere safe */ @@ -360,6 +364,12 @@ PUBLIC void style_initialiseHashTable NOARGS s_status = hash_code("status"); s_alert = hash_code("alert"); s_title = hash_code("title"); +#ifdef USE_SCROLLBAR + s_sb_bar = hash_code("scroll.bar"); + s_sb_bg = hash_code("scroll.back"); + s_sb_aa = hash_code("scroll.arrow"); + s_sb_naa = hash_code("scroll.noarrow"); +#endif } /* because curses isn't started when we parse the config file, we diff --git a/src/LYUtils.c b/src/LYUtils.c index 9e5b4548..f15839a3 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -3159,7 +3159,7 @@ PUBLIC void LYExtSignal ARGS2( * much state as possible. * Second arg is where to save or restore from. * Third arg to_dfl specifies what to do: - * 1 Save current state in where, set handling to SIG_DFL + * 1 Save current state in where, set handling to SIG_DFL * 0 Restore current state to previously saved one in where * * Currently only used for SIGTSTP without SLANG, to prevent (n)curses @@ -7052,7 +7052,7 @@ PUBLIC int LYCopyFile ARGS2( char *, src, char *, dst) { -#ifdef SH_EX +#if defined(DOSPATH) /* thanks to Hiroyuki Senshu */ #define BUF_SIZE 1024 @@ -7065,8 +7065,10 @@ PUBLIC int LYCopyFile ARGS2( return EOF; fout = fopen(dst, "wb"); - if (fout == NULL) + if (fout == NULL) { + fclose(fin); /* it was opened, yes? */ return EOF; + } while ((len = fread(buff, 1, BUF_SIZE, fin)) > 0) { fwrite(buff, 1, len, fout); @@ -7281,7 +7283,7 @@ PUBLIC char *LYSysShell NOARGS { char *shell = 0; #ifdef DOSPATH -#ifdef SH_EX +#ifdef WIN_EX shell = getenv("SHELL"); if (shell) { if (access(shell, 0) != 0) @@ -7301,7 +7303,7 @@ PUBLIC char *LYSysShell NOARGS if (shell == NULL) { shell = "command.com"; } -#endif /* SH_EX */ +#endif /* WIN_EX */ #else #ifdef __EMX__ if (getenv("SHELL") != NULL) { diff --git a/userdefs.h b/userdefs.h index 8dfbb130..acab24cf 100644 --- a/userdefs.h +++ b/userdefs.h @@ -1255,12 +1255,12 @@ * the version definition with the Project Version on checkout. Just * ignore it. - kw */ /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */ -#define LYNX_VERSION "2.8.3dev.5" +#define LYNX_VERSION "2.8.3dev.6" #define LYNX_WWW_HOME "http://lynx.browser.org/" #define LYNX_WWW_DIST "http://www.slcc.edu/lynx/current/" #define LYNX_RELEASE FALSE /* $Format: "#define LYNX_DATE \"$ProjectDate$\""$ */ -#define LYNX_DATE "Fri, 30 Jul 1999 09:39:54 -0600" +#define LYNX_DATE "Fri, 13 Aug 1999 07:27:27 -0600" #define LYNX_DATE_OFF 5 /* truncate the automatically-generated date */ #define LYNX_DATE_LEN 11 /* truncate the automatically-generated date */ #define LYNX_RELEASE_DATE "1999" |