aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-05-06 00:54:12 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-05-06 00:54:12 -0400
commitaa7067e195c6612fb732055a86ccea8158b17cfd (patch)
tree5cae83dedc745a09a4c060601e686faf3c85ac94 /src
parenta4a7d3a32615c1ea52c41ff149e291417fa1bdc8 (diff)
downloadlynx-snapshots-aa7067e195c6612fb732055a86ccea8158b17cfd.tar.gz
snapshot of project "lynx", label v2-8-2dev_26
Diffstat (limited to 'src')
-rw-r--r--src/HTML.c33
-rw-r--r--src/LYBookmark.c34
-rw-r--r--src/LYCgi.c2
-rw-r--r--src/LYCharUtils.c2
-rw-r--r--src/LYCookie.c37
-rw-r--r--src/LYDownload.c2
-rw-r--r--src/LYGetFile.c8
-rw-r--r--src/LYHistory.c30
-rw-r--r--src/LYList.c16
-rw-r--r--src/LYLocal.c6
-rw-r--r--src/LYMail.c5
-rw-r--r--src/LYMain.c14
-rw-r--r--src/LYMainLoop.c32
-rw-r--r--src/LYMap.c32
-rw-r--r--src/LYOptions.c11
-rw-r--r--src/LYPrettySrc.c4
-rw-r--r--src/LYPrettySrc.h3
-rw-r--r--src/LYReadCFG.c41
-rw-r--r--src/LYStrings.c8
-rw-r--r--src/LYStyle.c8
-rw-r--r--src/LYUtils.c4
-rw-r--r--src/LYUtils.h2
-rw-r--r--src/LYrcFile.c2
-rw-r--r--src/makefile.in3
24 files changed, 221 insertions, 118 deletions
diff --git a/src/HTML.c b/src/HTML.c
index 09c10d4e..b78d5ac0 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -212,7 +212,7 @@ PRIVATE void change_paragraph_style ARGS2(HTStructured *, me, HTStyle *,style)
/* FIXME: this should be amended to do the substitution only when not in a
* multibyte stream.
*/
-#if EXP_JAPANESE_SPACES
+#ifdef EXP_JAPANESE_SPACES
#define FIX_JAPANESE_SPACES \
(HTCJK == CHINESE || HTCJK == JAPANESE || HTCJK == TAIPEI)
/* don't replace '\n' with ' ' if Chinese or Japanese - HN
@@ -435,8 +435,19 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
*/
PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
{
- if (LYMapsOnly || s == NULL)
- return;
+#ifdef USE_PSRC
+ char* translated_string = NULL;
+#endif
+
+ if (LYMapsOnly || s == NULL)
+ return;
+#ifdef USE_PSRC
+ if (psrc_convert_string) {
+ StrAllocCopy(translated_string,s);
+ TRANSLATE_AND_UNESCAPE_ENTITIES(&translated_string, TRUE, FALSE);
+ s = (CONST char *) translated_string;
+ };
+#endif
switch (me->sp[0].tag_number) {
@@ -499,7 +510,7 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
(*p == ' ') || (*p == '\t')); p++)
; /* Ignore leaders */
if (!*p)
- return;
+ break;
UPDATE_STYLE;
}
for (; *p; p++) {
@@ -558,6 +569,12 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
} /* for */
}
} /* end switch */
+#ifdef USE_PSRC
+ if (psrc_convert_string) {
+ psrc_convert_string = FALSE;
+ FREE(translated_string);
+ }
+#endif
}
/* Buffer write
@@ -1365,8 +1382,9 @@ PRIVATE void HTML_start_element ARGS6(
me->node_anchor, /* Parent */
NULL, /* Tag */
href, /* Addresss */
- temp ?
- (HTLinkType*)HTAtom_for(temp) : INTERN_LT); /* Type */
+ temp
+ ? (HTLinkType*)HTAtom_for(temp)
+ : INTERN_LT); /* Type */
FREE(temp);
if ((dest = HTAnchor_parent(
HTAnchor_followMainLink((HTAnchor*)me->CurrentA)
@@ -3515,7 +3533,8 @@ PRIVATE void HTML_start_element ARGS6(
}
if (alt_string != NULL) {
TRANSLATE_AND_UNESCAPE_ENTITIES(&alt_string,
- me->UsePlainSpace, me->HiddenValue);
+ me->UsePlainSpace,
+ me->HiddenValue);
/*
* Make sure it's not just space(s). - FM
*/
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index 2cd5d7cf..23b79884 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -88,7 +88,7 @@ PUBLIC char * get_bookmark_filename ARGS1(
/*
* Seek it in the home path. - FM
*/
- LYAddPathToHome(filename_buffer,
+ LYAddPathToHome(filename_buffer,
sizeof(filename_buffer),
BookmarkPage);
CTRACE(tfp, "\nget_bookmark_filename: SEEKING %s\n AS %s\n\n",
@@ -132,7 +132,7 @@ success:
* file for handling as a Lynx bookmark file. - FM
*/
PRIVATE char * convert_mosaic_bookmark_file ARGS1(
- char *, filename_buffer)
+ char *, filename_buffer)
{
static char newfile[LY_MAXPATH];
FILE *fp, *nfp;
@@ -191,8 +191,8 @@ PRIVATE char* title_convert8bit PARAMS((CONST char *Title));
* to that file. - FM
*/
PUBLIC void save_bookmark_link ARGS2(
- char *, address,
- char *, title)
+ char *, address,
+ char *, title)
{
FILE *fp;
BOOLEAN first_time = FALSE;
@@ -308,9 +308,9 @@ PUBLIC void save_bookmark_link ARGS2(
/*
* Seek it in the home path. - FM
*/
- LYAddPathToHome(filename_buffer,
- sizeof(filename_buffer),
- BookmarkPage);
+ LYAddPathToHome(filename_buffer,
+ sizeof(filename_buffer),
+ BookmarkPage);
}
CTRACE(tfp, "\nsave_bookmark_link: SEEKING %s\n AS %s\n\n",
BookmarkPage, filename_buffer);
@@ -334,20 +334,20 @@ PUBLIC void save_bookmark_link ARGS2(
if (first_time) {
fprintf(fp,"<head>\n");
LYAddMETAcharsetToFD(fp, -1);
- fprintf(fp,"<title>%s</title>\n</head>\n",BOOKMARK_TITLE);
- fprintf(fp,gettext("\
+ fprintf(fp,"<title>%s</title>\n</head>\n", BOOKMARK_TITLE);
+ fprintf(fp, "%s<br>\n%s\n\n<!--\n%s\n-->\n\n<p>\n<ol>",
+ gettext("\
You can delete links using the remove bookmark command. It is usually\n\
the 'R' key but may have been remapped by you or your system\n\
- administrator.<br>\n\
+ administrator."),
+ gettext("\
This file also may be edited with a standard text editor to delete\n\
- outdated or invalid links, or to change their order.\n\n\
-<!--\n\
+ outdated or invalid links, or to change their order."),
+ gettext("\
Note: if you edit this file manually\n\
you should not change the format within the lines\n\
or add other HTML markup.\n\
- Make sure any bookmark link saved as a single line\n\
--->\n\n\
- <p>\n<ol>\n"));
+ Make sure any bookmark link is saved as a single line."));
}
/*
@@ -411,7 +411,7 @@ Note: if you edit this file manually\n\
*/
PUBLIC void remove_bookmark_link ARGS2(
int, cur,
- char *, cur_bookmark_page)
+ char *, cur_bookmark_page)
{
FILE *fp, *nfp;
char *buf = NULL;
@@ -867,7 +867,7 @@ PUBLIC BOOLEAN LYHaveSubBookmarks NOARGS
* string will be handled properly. - FM
*/
PUBLIC void LYMBM_statusline ARGS1(
- char *, text)
+ char *, text)
{
if (LYMultiBookmarks == TRUE && user_mode == NOVICE_MODE) {
LYStatusLine = (LYlines - 1);
diff --git a/src/LYCgi.c b/src/LYCgi.c
index 981d1c8e..a28725bb 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -320,7 +320,7 @@ PRIVATE int LYLoadCGI ARGS4(
int fd1[2], fd2[2];
char buf[1024];
pid_t pid;
-#if HAVE_TYPE_UNIONWAIT
+#ifdef HAVE_TYPE_UNIONWAIT
union wait wstatus;
#else
int wstatus;
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index b21c43e4..bd3110af 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -844,7 +844,7 @@ PUBLIC void LYGetChartransInfo ARGS1(
UCT_STAGE_STRUCTURED);
}
-#if NOTUSED_FOTEMODS
+#ifdef NOTUSED_FOTEMODS
/*
** This function reallocates an allocated string and converts
** characters for the current display character set. It assumes
diff --git a/src/LYCookie.c b/src/LYCookie.c
index 1597d49a..ee5a570e 100644
--- a/src/LYCookie.c
+++ b/src/LYCookie.c
@@ -2474,22 +2474,25 @@ Delete_all_cookies_in_domain:
* Load HTML strings into buf and pass buf
* to the target for parsing and rendering. - FM
*/
+#define PUTS(buf) (*target->isa->put_block)(target, buf, strlen(buf))
+
+
HTSprintf0(&buf, "<HEAD>\n<TITLE>%s</title>\n</HEAD>\n<BODY>\n",
COOKIE_JAR_TITLE);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "<h1>%s (%s)%s<a href=\"%s%s\">%s</a></h1>\n",
LYNX_NAME, LYNX_VERSION,
HELP_ON_SEGMENT,
helpfilepath, COOKIE_JAR_HELP, COOKIE_JAR_TITLE);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "<NOTE>%s\n", ACTIVATE_TO_GOBBLE);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "%s</NOTE>\n", OR_CHANGE_ALLOW);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "<DL COMPACT>\n");
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
for (dl = domain_list; dl != NULL; dl = dl->next) {
de = dl->object;
if (de == NULL)
@@ -2503,7 +2506,7 @@ Delete_all_cookies_in_domain:
*/
HTSprintf0(&buf, "<DT>%s<DD><A HREF=\"LYNXCOOKIE://%s/\">Domain=%s</A>\n",
de->domain, de->domain, de->domain);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
switch (de->bv) {
case (ACCEPT_ALWAYS):
HTSprintf0(&buf, COOKIES_ALWAYS_ALLOWED);
@@ -2520,9 +2523,9 @@ Delete_all_cookies_in_domain:
#endif
break;
}
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "\n");
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
/*
* Show the domain's cookies. - FM
@@ -2553,11 +2556,11 @@ Delete_all_cookies_in_domain:
de->domain, co->lynxID, name, value);
FREE(name);
FREE(value);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
if (co->flags & COOKIE_FLAG_FROM_FILE) {
HTSprintf0(&buf, "%s\n", gettext("(from a previous session)"));
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
}
/*
@@ -2574,14 +2577,14 @@ Delete_all_cookies_in_domain:
((co->flags & COOKIE_FLAG_SECURE) ? "YES" : "NO"),
((co->flags & COOKIE_FLAG_DISCARD) ? "YES" : "NO"));
FREE(path);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
/*
* Show the list of acceptable ports, if present. - FM
*/
if (co->PortList) {
HTSprintf0(&buf, "<DD>PortList=\"%s\"\n", co->PortList);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
}
/*
@@ -2598,7 +2601,7 @@ Delete_all_cookies_in_domain:
Title);
FREE(Address);
FREE(Title);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
}
/*
@@ -2609,7 +2612,7 @@ Delete_all_cookies_in_domain:
LYEntify(&comment, TRUE);
HTSprintf0(&buf, "<DD>Comment: %s\n", comment);
FREE(comment);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
}
/*
@@ -2623,13 +2626,13 @@ Delete_all_cookies_in_domain:
((co->flags & COOKIE_FLAG_EXPIRES_SET)
?
"" : "\n"));
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
}
HTSprintf0(&buf, "</DT>\n");
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
}
HTSprintf0(&buf, "</DL>\n</BODY>\n");
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
/*
* Free the target to complete loading of the
diff --git a/src/LYDownload.c b/src/LYDownload.c
index 30e374d6..82860707 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -299,7 +299,7 @@ check_recall:
if (HTCountCommandArgs(download_command->command) >= 2) {
_statusline(FILENAME_PROMPT);
again: if (sug_file)
- strcpy(buffer, sug_file);
+ strncpy(buffer, sug_file, sizeof(buffer));
else
*buffer = '\0';
check_again:
diff --git a/src/LYGetFile.c b/src/LYGetFile.c
index 7475f0ef..0850a8ae 100644
--- a/src/LYGetFile.c
+++ b/src/LYGetFile.c
@@ -328,7 +328,6 @@ Try_Redirected_URL:
*/
if ((historytarget(doc) == FALSE) ||
!doc || !doc->address) {
- HTMLSetCharacterHandling(current_char_set);
return(NOT_FOUND);
}
@@ -348,10 +347,8 @@ Try_Redirected_URL:
#endif
if (!HTLoadAbsolute(&WWWDoc)) {
- HTMLSetCharacterHandling(current_char_set);
return(NOT_FOUND);
}
- HTMLSetCharacterHandling(current_char_set);
return(NORMAL);
} else if (url_type == LYNXEXEC_URL_TYPE ||
@@ -718,7 +715,6 @@ Try_Redirected_URL:
}
FREE(temp);
}
- HTMLSetCharacterHandling(current_char_set);
url_type = is_url(use_this_url_instead);
if (url_type == LYNXDOWNLOAD_URL_TYPE ||
url_type == LYNXEXEC_URL_TYPE ||
@@ -827,7 +823,6 @@ Try_Redirected_URL:
*/
goto Try_Redirected_URL;
}
- HTMLSetCharacterHandling(current_char_set);
return(NOT_FOUND);
}
@@ -857,7 +852,6 @@ Try_Redirected_URL:
HTParentAnchor *tmpanchor;
char *fname = NULL;
- HTMLSetCharacterHandling(current_char_set);
/*
* Check for a suggested filename from
* the Content-Disposition header. - FM
@@ -922,7 +916,6 @@ Try_Redirected_URL:
* Also check the isHEAD element. - FM
*/
doc->isHEAD != HTLoadedDocumentIsHEAD())) {
- HTMLSetCharacterHandling(current_char_set);
/*
* Nothing needed to be shown.
*/
@@ -935,7 +928,6 @@ Try_Redirected_URL:
*/
if (pound != NULL)
HTFindPoundSelector(pound+1);
- HTMLSetCharacterHandling(current_char_set);
return(NORMAL);
}
}
diff --git a/src/LYHistory.c b/src/LYHistory.c
index afaa0512..fa1eeaab 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -612,6 +612,20 @@ PUBLIC int LYShowVisitedLinks ARGS1(
#define STATUSBUFSIZE 40
PRIVATE char * buffstack[STATUSBUFSIZE];
PRIVATE int topOfStack = 0;
+#ifdef LY_FIND_LEAKS
+PRIVATE int already_registered_free_messages_stack = 0;
+#endif
+
+#ifdef LY_FIND_LEAKS
+PRIVATE void free_messages_stack NOARGS
+{
+ topOfStack = STATUSBUFSIZE;
+
+ while (--topOfStack >= 0) {
+ FREE(buffstack[topOfStack]);
+ }
+}
+#endif
PRIVATE void to_stack ARGS1(char *, str)
{
@@ -619,7 +633,7 @@ PRIVATE void to_stack ARGS1(char *, str)
* Cycle buffer:
*/
if (topOfStack == STATUSBUFSIZE) {
- topOfStack = 0;
+ topOfStack = 0;
}
/*
@@ -628,18 +642,14 @@ PRIVATE void to_stack ARGS1(char *, str)
FREE(buffstack[topOfStack]);
buffstack[topOfStack] = str;
topOfStack++;
-}
-
#ifdef LY_FIND_LEAKS
-PRIVATE void free_messages_stack NOARGS
-{
- topOfStack = STATUSBUFSIZE;
-
- while (--topOfStack >= 0) {
- FREE(buffstack[topOfStack]);
+ if(!already_registered_free_messages_stack) {
+ already_registered_free_messages_stack = 1;
+ atexit(free_messages_stack);
}
-}
#endif
+}
+
/*
* Status line messages list, LYNXMESSAGES:/ internal page,
diff --git a/src/LYList.c b/src/LYList.c
index 0374f31e..f1e111ff 100644
--- a/src/LYList.c
+++ b/src/LYList.c
@@ -53,6 +53,7 @@ PUBLIC int showlist ARGS2(
static char tempfile[LY_MAXPATH];
FILE *fp0;
char *Address = NULL, *Title = NULL, *cp = NULL;
+ char *LinkTitle = NULL; /* Rel stored as property of link, not of dest */
BOOLEAN intern_w_post = FALSE;
char *desc = "unknown field or link";
@@ -82,7 +83,7 @@ PUBLIC int showlist ARGS2(
#ifdef EXP_ADDRLIST_PAGE
if (titles != TRUE)
- BeginInternalPage(fp0, ADDRLIST_PAGE_TITLE, LIST_PAGE_HELP);
+ BeginInternalPage(fp0, ADDRLIST_PAGE_TITLE, LIST_PAGE_HELP);
else
#endif
BeginInternalPage(fp0, LIST_PAGE_TITLE, LIST_PAGE_HELP);
@@ -154,6 +155,16 @@ PUBLIC int showlist ARGS2(
}
address = HTAnchor_address(dest);
title = titles ? HTAnchor_title(parent) : NULL;
+ if (dest_intl) {
+ HTSprintf0(&LinkTitle, "(internal)");
+ } else if (titles && child->mainLink.type &&
+ dest == child->mainLink.dest &&
+ !strncmp(HTAtom_name(child->mainLink.type),
+ "RelTitle: ", 10)) {
+ HTSprintf0(&LinkTitle, "(%s)", HTAtom_name(child->mainLink.type)+10);
+ } else {
+ FREE(LinkTitle);
+ }
StrAllocCopy(Address, address);
FREE(address);
LYEntify(&Address, TRUE);
@@ -169,7 +180,7 @@ PUBLIC int showlist ARGS2(
fprintf(fp0, "<li><a href=\"%s\"%s>%s%s%s%s%s</a>\n", Address,
dest_intl ? " TYPE=\"internal link\"" : "",
- dest_intl ? "(internal) " : "",
+ LinkTitle ? LinkTitle : "",
((HTAnchor*)parent != dest) && Title ? "in " : "",
(char *)(Title ? Title : Address),
(Title && cp) ? " - " : "",
@@ -178,6 +189,7 @@ PUBLIC int showlist ARGS2(
FREE(Address);
FREE(Title);
}
+ FREE(LinkTitle);
if (hidden_links > 0) {
if (refs > 0)
diff --git a/src/LYLocal.c b/src/LYLocal.c
index f968da0b..03138509 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -53,7 +53,7 @@
#endif /* VMS */
#ifndef WEXITSTATUS
-# if HAVE_TYPE_UNIONWAIT
+# ifdef HAVE_TYPE_UNIONWAIT
# define WEXITSTATUS(status) (status.w_retcode)
# else
# define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
@@ -61,7 +61,7 @@
#endif
#ifndef WTERMSIG
-# if HAVE_TYPE_UNIONWAIT
+# ifdef HAVE_TYPE_UNIONWAIT
# define WTERMSIG(status) (status.w_termsig)
# else
# define WTERMSIG(status) ((status) & 0x7f)
@@ -2033,7 +2033,7 @@ PRIVATE int LYExecv ARGS3(
int rc;
char *tmpbuf = 0;
pid_t pid;
-#if HAVE_TYPE_UNIONWAIT
+#ifdef HAVE_TYPE_UNIONWAIT
union wait wstatus;
#else
int wstatus;
diff --git a/src/LYMail.c b/src/LYMail.c
index a5558fae..d4d6a812 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -37,8 +37,9 @@ PRIVATE void SafeHTUnEscape ARGS1(
HTUnEscape(string);
for (i=0; string[i] != '\0'; i++)
{
- /* FIXME: this is explicitly 7-bit ASCII */
- if (string[i] < ' ' || string[i] >= 127)
+ /* FIXME: this is no longer explicitly 7-bit ASCII,
+ but are there portability problems? */
+ if ((!LYIsASCII(string[i])) || !isprint(string[i]))
{
string[i] = '?';
flg = TRUE;
diff --git a/src/LYMain.c b/src/LYMain.c
index 50c06151..a5e2485e 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -44,7 +44,11 @@
#endif /* !VMS */
#ifdef LOCALE
+#undef gettext /* Solaris locale.h prototypes gettext() */
#include <locale.h>
+#ifndef HAVE_GETTEXT
+#define gettext(s) s
+#endif
#endif /* LOCALE */
#include <LYexit.h>
@@ -1843,9 +1847,9 @@ PUBLIC void LYRegisterLynxProtocols NOARGS
#ifndef NO_CONFIG_INFO
/*
- * Some staff to reload lynx.cfg without restarting new lynx session,
+ * Some stuff to reload lynx.cfg without restarting new lynx session,
* also load options menu items and command-line options
- * to made things consistent. Not implemented yet.
+ * to make things consistent. Not implemented yet.
* Warning: experimental, more main() reorganization required.
*
* Called by user of interactive session by LYNXCFG://reload/ link.
@@ -2553,6 +2557,12 @@ static int version_fun ARGS1(
LYNX_RELEASE ? LYNX_RELEASE_DATE : &LYNX_DATE[LYNX_DATE_OFF]
);
#ifdef SYSTEM_NAME
+#ifndef __DATE__
+#define __DATE__ ""
+#endif
+#ifndef __TIME__
+#define __TIME__ ""
+#endif
printf(gettext("Built on %s %s %s\n"), SYSTEM_NAME, __DATE__, __TIME__);
#endif
printf("\n");
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 1106bcb4..0997b953 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -961,7 +961,6 @@ try_again:
newdoc.line = curdoc.line;
newdoc.link = curdoc.link;
newdoc.internal_link = FALSE; /* can't be true. - kw */
- Newline = newdoc.line; /* now here, no partial mode */
}
/*
@@ -969,9 +968,22 @@ try_again:
* line the user was on if s/he has been in the file
* before, or it is 1 if this is a new file.
*/
+#ifdef DISP_PARTIAL
/* Newline = newdoc.line; */
/* - alreary set and probably updated in partial mode */
- /* End of incremental rendering stage here. */
+ /* incremental rendering stage already closed (but see below) */
+
+ if (Newline != Newline_partial || display_partial == TRUE) {
+ /* This is the case when we came from the history stack
+ * _and_ cached HText was used instead of HT*Copy() call.
+ * Set Newline and close partial mode here.
+ */
+ Newline = Newline_partial;
+ display_partial = FALSE;
+ }
+#else
+ Newline = newdoc.line; /* now here, no partial mode */
+#endif
/*
* If we are going to a target line or
@@ -1052,6 +1064,8 @@ try_again:
psrc_view = FALSE;
#endif
+ HTMLSetCharacterHandling(current_char_set); /* restore, for sure? */
+
/*
* Reset all of the other relevant flags. - FM
*/
@@ -3616,6 +3630,16 @@ check_recall:
}
check_goto_URL:
+ /* allow going to anchors*/
+ if (*user_input_buffer == '#' ) {
+ if ( user_input_buffer[1] &&
+ HTFindPoundSelector(user_input_buffer+1) ) {
+ /* HTFindPoundSelector will initialize www_search_result,
+ so we do nothing else. */
+ HTAddGotoURL(user_input_buffer);
+ }
+ break;
+ }
/*
* If its not a URL then make it one.
*/
@@ -6012,7 +6036,9 @@ PUBLIC void HTAddGotoURL ARGS1(
* put a message on the screen
* to tell the user other misc info.
*/
-PRIVATE void print_status_message(CONST linkstruct curlink, char **cp)
+PRIVATE void print_status_message ARGS2(
+ CONST linkstruct, curlink,
+ char **, cp)
{
/*
* Make sure form novice lines are replaced.
diff --git a/src/LYMap.c b/src/LYMap.c
index 6df8924f..05593910 100644
--- a/src/LYMap.c
+++ b/src/LYMap.c
@@ -537,12 +537,14 @@ PRIVATE int LYLoadIMGmap ARGS4 (
LYEntify(&MapTitle, TRUE);
}
+#define PUTS(buf) (*target->isa->put_block)(target, buf, strlen(buf))
+
HTSprintf0(&buf, "<html>\n<head>\n");
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "<META %s content=\"text/html;charset=%s\">\n",
"http-equiv=\"content-type\"",
LYCharSet_UC[current_char_set].MIMEname);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
/*
* This page is a list of titles and anchors for them.
* Since titles already passed SGML/HTML stage
@@ -550,43 +552,43 @@ PRIVATE int LYLoadIMGmap ARGS4 (
* That is why we insist on META charset for this page.
*/
HTSprintf0(&buf, "<title>%s</title>\n", MapTitle);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "</head>\n<body>\n");
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf,"<h1><em>%s</em></h1>\n", MapTitle);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
StrAllocCopy(MapAddress, address);
LYEntify(&MapAddress, FALSE);
HTSprintf0(&buf,"<h2><em>MAP:</em>&nbsp;%s</h2>\n", MapAddress);
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
HTSprintf0(&buf, "<%s compact>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
"ol" : "ul"));
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
cur = theMap->elements;
while (NULL != (new=(LYMapElement *)HTList_nextObject(cur))) {
StrAllocCopy(MapAddress, new->address);
LYEntify(&MapAddress, FALSE);
- (*target->isa->put_block)(target, "<li><a href=\"", 13);
- (*target->isa->put_block)(target, MapAddress, strlen(MapAddress));
+ PUTS("<li><a href=\"");
+ PUTS(MapAddress);
+ PUTS("\"");
#ifndef DONT_TRACK_INTERNAL_LINKS
if (new->intern_flag)
- (*target->isa->put_block)(target, "\" TYPE=\"internal link\"\n>",24);
- else
+ PUTS(" TYPE=\"internal link\"");
#endif
- (*target->isa->put_block)(target, "\"\n>", 3);
+ PUTS("\n>");
StrAllocCopy(MapTitle, new->title);
LYEntify(&MapTitle, TRUE);
- (*target->isa->put_block)(target, MapTitle, strlen(MapTitle));
- (*target->isa->put_block)(target, "</a>\n", 5);
+ PUTS(MapTitle);
+ PUTS("</a>\n");
}
HTSprintf0(&buf, "</%s>\n</body>\n</html>\n",
((keypad_mode == NUMBERS_AS_ARROWS)
? "ol"
: "ul"));
- (*target->isa->put_block)(target, buf, strlen(buf));
+ PUTS(buf);
(*target->isa->_free)(target);
FREE(MapAddress);
diff --git a/src/LYOptions.c b/src/LYOptions.c
index a99e6b0d..524e91e4 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -28,6 +28,10 @@ BOOLEAN term_options;
PRIVATE void terminate_options PARAMS((int sig));
+#if !defined(NO_OPTION_MENU) || defined(NCURSES_MOUSE_VERSION)
+#define COL_OPTION_VALUES 36 /* display column where option values start */
+#endif
+
#ifndef NO_OPTION_MENU
PRIVATE int boolean_choice PARAMS((
int status,
@@ -98,9 +102,6 @@ PRIVATE int boolean_choice PARAMS((
#define B_VERBOSE_IMAGES 50
#define C_VERBOSE_IMAGES (B_VERBOSE_IMAGES + 21)
-
-#define COL_OPTION_VALUES 36 /* display column where option values start */
-
/* a kludge to add assume_charset only in ADVANCED mode... */
#define L_Bool_A (use_assume_charset ? L_BOOL_A + 1 : L_BOOL_A)
#define L_Bool_B (use_assume_charset ? L_BOOL_B + 1 : L_BOOL_B)
@@ -2164,7 +2165,7 @@ draw_bookmark_list:
signal(SIGINT, cleanup_sig);
}
-#ifndef NO_OPTION_MENU
+#if !defined(NO_OPTION_MENU) || defined(NCURSES_MOUSE_VERSION)
/*
** This function prompts for a choice or page number.
** If a 'g' or 'p' suffix is included, that will be
@@ -3962,7 +3963,7 @@ PUBLIC int postoptions ARGS1(
if (!HTLoadAbsolute(&WWWDoc))
return(NOT_FOUND);
- reloading = FALSE; /* set manually */
+ reloading = FALSE; /* set manually */
/* force end-to-end reload from remote server if change LYUserAgent
* or language or pref_charset (marked by need_end_reload flag above),
* from old-style LYK_OPTIONS (mainloop):
diff --git a/src/LYPrettySrc.c b/src/LYPrettySrc.c
index e9c4b76e..79a292a2 100644
--- a/src/LYPrettySrc.c
+++ b/src/LYPrettySrc.c
@@ -7,12 +7,12 @@
#include <LYPrettySrc.h>
#ifdef USE_PSRC
-
+BOOL psrc_convert_string = FALSE;
PUBLIC BOOL psrc_view = FALSE;/* this is read by SGML_put_character - TRUE
when viewing pretty source */
PUBLIC BOOL LYpsrc = FALSE; /* this tells what will be shown on '\':
if TRUE, then pretty source, normal source view otherwise. Toggled by
- -pretty_source commandline option. */
+ -prettysrc commandline option. */
PUBLIC BOOL sgml_in_psrc_was_initialized;
PUBLIC BOOL psrc_nested_call;
PUBLIC BOOL psrc_first_tag;
diff --git a/src/LYPrettySrc.h b/src/LYPrettySrc.h
index 88780bd6..14f53c38 100644
--- a/src/LYPrettySrc.h
+++ b/src/LYPrettySrc.h
@@ -5,6 +5,9 @@
#include <HTMLDTD.h>
+extern BOOL psrc_convert_string;
+ /*whether HTML_put_string should convert string passed with
+ TRANSLATE_AND_UNESCAPE_TO_STD */
extern BOOL psrc_view;
extern BOOL LYpsrc;
extern BOOL sgml_in_psrc_was_initialized;
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index dacdc65d..d85edeb5 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1177,7 +1177,7 @@ static Config_Type Config_Table [] =
PARSE_ENV("wais_proxy", CONF_ENV, 0 ),
PARSE_STR("xloadimage_command", CONF_STR, &XLoadImageCommand),
- {0}
+ {0, 0, 0}
};
/*
@@ -1196,6 +1196,21 @@ PUBLIC void free_lynx_cfg NOARGS
switch (tbl->type) {
case CONF_ENV:
if (q->str_value != 0) {
+ char *name = *(q->str_value);
+ char *eqls = strchr(name, '=');
+ if (eqls != 0) {
+ *eqls = 0;
+#ifdef VMS
+ Define_VMSLogical(name, NULL);
+#else
+# ifdef HAVE_UNSETENV
+ unsetenv(name);
+# else
+ if (putenv(name))
+ break;
+# endif
+#endif
+ }
FREE(*(q->str_value));
FREE(q->str_value);
/* is it enough for reload_read_cfg() to clean up
@@ -1421,9 +1436,16 @@ PRIVATE void do_read_cfg ARGS5(
char *url = NULL;
char *cp1 = NULL;
+ char *sep = NULL;
- if ((p1 = strchr(value,':')) != 0)
- *p1++ ='\0';
+ if ( (p1 = strstr(value, sep=" for ")) != 0
+#if defined(UNIX) && !defined(__EMX__)
+ || (p1 = strstr(value, sep=":")) != 0
+#endif
+ ) {
+ *p1 = '\0';
+ p1 += strlen(sep);
+ }
#ifndef NO_CONFIG_INFO
if (fp0 != 0 && !LYRestricted) {
@@ -1434,7 +1456,7 @@ PRIVATE void do_read_cfg ARGS5(
}
fprintf(fp0, "%s:<a href=\"%s\">%s</a>\n\n", name, url, cp1);
- fprintf(fp0, " #&lt;begin %s&gt;\n", cp1);
+ fprintf(fp0, " #&lt;begin %s&gt;\n", cp1);
}
#endif
@@ -1460,7 +1482,10 @@ PRIVATE void do_read_cfg ARGS5(
}
cur_set[tbl2 - Config_Table] = FALSE;
}
- *p2 = savechar;
+ if (savechar && p2[1])
+ p1 = p2 + 1;
+ else
+ break;
}
}
if (!allowed) {
@@ -1487,13 +1512,13 @@ PRIVATE void do_read_cfg ARGS5(
char *buf = NULL;
unsigned i;
- fprintf(fp0," Options allowed in this file:\n");
+ fprintf(fp0," Options allowed in this file:\n");
for (i = 0; i < NOPTS_; ++i) {
if ((*resultant_set)[i])
continue;
StrAllocCopy(buf, Config_Table[i].name);
LYUpperCase(buf);
- fprintf(fp0," * %s\n", buf);
+ fprintf(fp0," * %s\n", buf);
}
free(buf);
}
@@ -1502,7 +1527,7 @@ PRIVATE void do_read_cfg ARGS5(
#ifndef NO_CONFIG_INFO
if (fp0 != 0 && !LYRestricted) {
- fprintf(fp0, " #&lt;end of %s&gt;\n\n", cp1);
+ fprintf(fp0, " #&lt;end of %s&gt;\n\n", cp1);
FREE(url);
FREE(cp1);
}
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 572af317..1e725ee1 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -998,7 +998,7 @@ PUBLIC int lynx_initialize_keymaps NOARGS
#ifdef NCURSES_MOUSE_VERSION
PRIVATE int LYmouse_menu ARGS3(int, x, int, y, int, atlink)
{
- char *choices[] = {
+ static char *choices[] = {
"Quit",
"Home page",
"Previous document",
@@ -1024,7 +1024,7 @@ PRIVATE int LYmouse_menu ARGS3(int, x, int, y, int, atlink)
"Set Options",
NULL
};
- char *choices_link[] = {
+ static char *choices_link[] = {
"Help",
"Do nothing",
"Activate this link",
@@ -1032,7 +1032,7 @@ PRIVATE int LYmouse_menu ARGS3(int, x, int, y, int, atlink)
"Download",
NULL
};
- int actions[] = {
+ static int actions[] = {
LYK_ABORT,
LYK_MAIN_MENU,
LYK_PREV_DOC,
@@ -1057,7 +1057,7 @@ PRIVATE int LYmouse_menu ARGS3(int, x, int, y, int, atlink)
LYK_INDEX_SEARCH,
LYK_OPTIONS
};
- int actions_link[] = {
+ static int actions_link[] = {
LYK_HELP,
LYK_REFRESH,
LYK_ACTIVATE,
diff --git a/src/LYStyle.c b/src/LYStyle.c
index cab00fa7..f2be6970 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.26 Tue, 27 Apr 1999 06:59:06 -0600 dickey @
+ * @Id: LYStyle.c 1.27 Wed, 05 May 1999 18:33:59 -0600 dickey @
*/
#include <HTUtils.h>
#include <HTML.h>
@@ -466,8 +466,8 @@ PUBLIC void TrimColorClass ARGS3(
(styleclassname ? styleclassname : "<null>"), tmp);
}
-/* This function is desgined as faster analog to TrimColorClass.
- It assumes that tag_name is presentin stylename! -HV
+/* This function is designed as faster analog to TrimColorClass.
+ It assumes that tag_name is present in stylename! -HV
*/
PUBLIC void FastTrimColorClass ARGS5 (
CONST char*, tag_name,
@@ -482,7 +482,7 @@ PUBLIC void FastTrimColorClass ARGS5 (
{
for (; tag_start >= stylename && *tag_start!=';' ; --tag_start)
;
- if ( !strncasecmp(tag_start+1, tag_name, name_len) ) break;
+ if ( !strncasecomp(tag_start+1, tag_name, name_len) ) break;
--tag_start;
}
*tag_start = '\0';
diff --git a/src/LYUtils.c b/src/LYUtils.c
index debd52fc..cfb9028d 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -45,7 +45,7 @@
#endif /* UTMPX_FOR_UTMP */
#endif /* HAVE_UTMP */
-#if NEED_PTEM_H
+#ifdef NEED_PTEM_H
/* they neglected to define struct winsize in termios.h -- it's only in
* termio.h and ptem.h (the former conflicts with other definitions).
*/
@@ -4931,7 +4931,7 @@ PUBLIC char *LYPathLeaf ARGS1(char *, pathname)
int n;
for (leaf = 0, n = strlen(pathname)-1; n >= 0; n--) {
if (strchr("\\/:", pathname[n]) != 0) {
- leaf = pathname + n;
+ leaf = pathname + n + 1;
break;
}
}
diff --git a/src/LYUtils.h b/src/LYUtils.h
index f2362422..bf9cfed7 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -190,7 +190,7 @@ typedef enum {
LYNXCOMPILE_OPTS_URL_TYPE,
LYNXMESSAGES_URL_TYPE,
- PROXY_URL_TYPE,
+ PROXY_URL_TYPE
} UrlTypes;
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index 5f5227de..50c5409d 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -1012,7 +1012,7 @@ WARNING - This is potentially VERY dangerous. Since you may view\n\
* Local execution mode - only links in local files.
*/
write_list(fp, gettext("\
-If run_execution_links_on_local_files is set \"on\" then all local\n
+If run_execution_links_on_local_files is set \"on\" then all local\n\
execution links that are found in LOCAL files will be executed when they\n\
are selected. This is different from run_all_execution_links in that\n\
only files that reside on the local system will have execution link\n\
diff --git a/src/makefile.in b/src/makefile.in
index 415bb8a0..a46b42e3 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -44,10 +44,9 @@ CPP_OPTS = $(DEFS) $(CPPFLAGS) \
-Ichrtrans \
-I$(srcdir)/chrtrans \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/src \
-I$(top_srcdir)/$(WWWINC) \
- $(SITE_DEFS)
+ @INTLDIR_CPPFLAGS@ $(SITE_DEFS)
CC_OPTS = $(CPP_OPTS) $(CFLAGS)
LINT = @LINT@