diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2001-08-15 22:23:14 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2001-08-15 22:23:14 -0400 |
commit | fc99820d832c512631aa418520f5bc6a204e8b91 (patch) | |
tree | 6822b3a150ca0ef4e7f9bc3dc2d3dc95d63dc7ca /WWW/Library | |
parent | 864412f0359169368927737c2908ff357ea343a0 (diff) | |
download | lynx-snapshots-fc99820d832c512631aa418520f5bc6a204e8b91.tar.gz |
snapshot of project "lynx", label v2-8-5dev_2
Diffstat (limited to 'WWW/Library')
-rw-r--r-- | WWW/Library/Implementation/HTAnchor.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFile.c | 52 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTP.c | 3 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTelnet.c | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HText.h | 8 | ||||
-rw-r--r-- | WWW/Library/Implementation/www_tcp.h | 13 |
6 files changed, 49 insertions, 37 deletions
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index d336cb7b..be8b59dd 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -269,13 +269,13 @@ PUBLIC HTChildAnchor * HTAnchor_findChildAndLink ARGS4( #ifdef DUPLICATE_ANCHOR_NAME_WORKAROUND if (tag && *tag) { HTAnchor *testdest1; - int nlinks; + int child_links; testdest1 = child->mainLink.dest; if (testdest1) { - nlinks = 1 + HTList_count(child->links); + child_links = 1 + HTList_count(child->links); CTRACE((tfp, "*** Duplicate ChildAnchor %p named `%s' with %d links", - child, tag, nlinks)); + child, tag, child_links)); if (dest == testdest1 && ltype == child->mainLink.type) { CTRACE((tfp,", same dest %p and type, keeping it\n", testdest1)); diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index 829214e8..67e566c0 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -194,6 +194,7 @@ PRIVATE void LYListFmtParse ARGS5( struct stat st; char *buf = NULL; char tmp[LY_MAXPATH]; + char tmp2[LY_MAXPATH]; char type; #ifndef _WINDOWS char *name; @@ -228,7 +229,9 @@ PRIVATE void LYListFmtParse ARGS5( #define PTBIT(a, s) PBIT(a, 0, 0) #endif - if (lstat(file, &st) < 0) + strcpy(tmp2, file); + LYTrimPathSep (tmp2); + if (lstat(tmp2, &st) < 0) fmtstr = " %a"; /* can't stat so just do anchor */ StrAllocCopy(str, fmtstr); @@ -1411,7 +1414,7 @@ PUBLIC BOOL HTDirTitles ARGS3( } cp = NULL; } - current = strrchr(path, '/'); /* last part or "" */ + current = LYPathLeaf (path); /* last part or "" */ { char * printable = NULL; @@ -1429,7 +1432,7 @@ PUBLIC BOOL HTDirTitles ARGS3( FREE(cp); } #else - StrAllocCopy(printable, (current ? current + 1 : "")); + StrAllocCopy(printable, current); HTUnEscape(printable); #endif /* DIRED_SUPPORT */ @@ -1475,11 +1478,13 @@ PUBLIC BOOL HTDirTitles ARGS3( #ifdef DOSPATH if (current != path) /* leave "/c:" alone */ #endif - if (current && current[1]) { /* was a slash AND something else too */ + if (current - path > 1 + && LYIsPathSep(current[-1]) + && current[0] != '\0') { /* was a slash AND something else too */ char * parent = NULL; char * relative = NULL; - *current++ = '\0'; + current[-1] = '\0'; parent = strrchr(path, '/'); /* penultimate slash */ if ((parent && @@ -1661,6 +1666,7 @@ PRIVATE int print_local_dir ARGS5( struct stat file_info; int status; int i; + int code; CTRACE((tfp, "print_local_dir() started\n")); @@ -1759,14 +1765,13 @@ PRIVATE int print_local_dir ARGS5( continue; StrAllocCopy(tmpfilename, localname); - if (strcmp(localname, "/")) - /* - ** If filename is not root directory. - */ - StrAllocCat(tmpfilename, "/"); + /* + ** If filename is not root directory, add trailing separator. + */ + LYAddPathSep(&tmpfilename); StrAllocCat(tmpfilename, dirbuf->d_name); - stat(tmpfilename, &file_info); + code = stat(tmpfilename, &file_info); #ifndef DIRED_SUPPORT if (S_ISDIR(file_info.st_mode)) HTSprintf0(&dirname, "D%s",dirbuf->d_name); @@ -1774,16 +1779,16 @@ PRIVATE int print_local_dir ARGS5( HTSprintf0(&dirname, "F%s",dirbuf->d_name); /* D & F to have first directories, then files */ #else - if (S_ISDIR(file_info.st_mode)) - { - if (dir_list_style == MIXED_STYLE) - HTSprintf0(&dirname, " %s/", dirbuf->d_name); - else if (!strcmp(dirbuf->d_name, "..")) + if (S_ISDIR(file_info.st_mode)) { + if (dir_list_style == MIXED_STYLE) { + HTSprintf0(&dirname, " %s", dirbuf->d_name); + LYAddPathSep(&dirname); + } else if (!strcmp(dirbuf->d_name, "..")) { HTSprintf0(&dirname, "A%s", dirbuf->d_name); - else + } else { HTSprintf0(&dirname, "D%s", dirbuf->d_name); - } - else if (dir_list_style == MIXED_STYLE) + } + } else if (dir_list_style == MIXED_STYLE) HTSprintf0(&dirname, " %s", dirbuf->d_name); else if (dir_list_style == FILES_FIRST) HTSprintf0(&dirname, "C%s", dirbuf->d_name); @@ -1848,11 +1853,10 @@ PRIVATE int print_local_dir ARGS5( } #endif StrAllocCopy(tmpfilename,localname); - if (strcmp(localname, "/")) - /* - ** If filename is not root directory. - */ - LYAddHtmlSep(&tmpfilename); + /* + ** If filename is not root directory. + */ + LYAddPathSep(&tmpfilename); entry = (char*)HTBTree_object(next_element)+1; /* diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 0e7af29d..51450145 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -675,7 +675,8 @@ use_tunnel: first_Accept = FALSE; len = 0; - HTSprintf(&command, "Accept-Encoding: %s, %s%c%c", + if (!LYPrependBaseToSource) + HTSprintf(&command, "Accept-Encoding: %s, %s%c%c", "gzip", "compress", CR, LF); if (language && *language) { diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c index 393e6051..b89b4c2d 100644 --- a/WWW/Library/Implementation/HTTelnet.c +++ b/WWW/Library/Implementation/HTTelnet.c @@ -33,6 +33,10 @@ #include <LYStrings.h> #include <LYLeaks.h> +#ifdef __DJGPP__ +#include <sys/exceptn.h> +#include <go32.h> +#endif /* __DJGPP__ */ PRIVATE void do_system ARGS1(char *, command) { diff --git a/WWW/Library/Implementation/HText.h b/WWW/Library/Implementation/HText.h index b1a11ba4..d35eeed5 100644 --- a/WWW/Library/Implementation/HText.h +++ b/WWW/Library/Implementation/HText.h @@ -149,14 +149,6 @@ extern void HText_appendImage PARAMS(( /* - DUMP DIAGNOSTICS TO STDERR - - */ - -extern void HText_dump PARAMS((HText * me)); - -/* - RETURN THE ANCHOR ASSOCIATED WITH THIS NODE */ diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h index f3f5ac65..05aa61e8 100644 --- a/WWW/Library/Implementation/www_tcp.h +++ b/WWW/Library/Implementation/www_tcp.h @@ -553,15 +553,17 @@ extern int errno; #define DECL_ERRNO #include <errno.h> #include <sys/types.h> -#include <socket.h> #include <io.h> #ifdef WATT32 +#include <sys/socket.h> #include <arpa/inet.h> #include <tcp.h> #ifdef word #undef word #endif /* word */ #define select select_s +#else +#include <socket.h> #endif /* WATT32 */ #undef NETWRITE @@ -570,12 +572,21 @@ extern int errno; #define NETREAD read_s #undef NETCLOSE #define NETCLOSE close_s +#ifdef UNIX +#undef UNIX +#endif /* UNIX */ #ifndef WATT32 #define getsockname getsockname_s #endif /* !WATT32 */ #ifdef HAVE_GETTEXT #define gettext gettext__ #endif +#if !defined(NCURSES) && !defined(USE_SLANG) +#define HAVE_CBREAK 1 +#endif /* !NCURSES && !USE_SLANG */ +#if defined(USE_SLANG) && !defined(NO_DJ_KEYHANDLER) && defined(HAVE_CONFIG_H) +#define DJGPP_KEYHANDLER +#endif /* USE_SLANG && !NO_DJ_KEYHANDLER && HAVE_CONFIG_H */ #endif /* DJGPP */ #ifdef HAVE_UNISTD_H |