summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 19:36:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 19:36:22 +0000
commitb799a1275c8e4bb4f1f07ce3e237708902cb8922 (patch)
treec75168eb236d7b16cda59ed6a27a937367d58dfe /src
parentReleasing progress-linux version 2.9.0rel.0-2~progress7.99u1. (diff)
downloadlynx-b799a1275c8e4bb4f1f07ce3e237708902cb8922.tar.xz
lynx-b799a1275c8e4bb4f1f07ce3e237708902cb8922.zip
Merging upstream version 2.9.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c20
-rw-r--r--src/HTFWriter.c4
-rw-r--r--src/LYBookmark.c268
-rw-r--r--src/LYCharSets.c35
-rw-r--r--src/LYIcon.rc10
-rw-r--r--src/LYMain.c5
-rw-r--r--src/LYMainLoop.c42
-rw-r--r--src/LYReadCFG.c6
-rw-r--r--src/TRSTable.c5
-rw-r--r--src/chrtrans/README.tables2
-rw-r--r--src/makefile.in11
11 files changed, 319 insertions, 89 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 806a053..419f6ee 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: GridText.c,v 1.347 2024/01/15 19:11:55 Gisle.Vanem Exp $
+ * $LynxId: GridText.c,v 1.349 2024/04/11 20:24:32 tom Exp $
*
* Character grid hypertext object
* ===============================
@@ -6002,7 +6002,7 @@ static void HText_trimHightext(HText *text,
int final,
int stop_before)
{
- int cur_line, cur_shift;
+ int cur_line;
TextAnchor *anchor_ptr;
TextAnchor *prev_a = NULL;
HTLine *line_ptr;
@@ -6097,7 +6097,6 @@ static void HText_trimHightext(HText *text,
anchor_ptr->number,
anchor_ptr->extent));
- cur_shift = 0;
/*
* Strip off any spaces or SpecialAttrChars at the beginning,
* if they exist, but only on HYPERTEXT_ANCHORS.
@@ -6108,7 +6107,6 @@ static void HText_trimHightext(HText *text,
IsSpecialAttrChar(ch)) {
anchor_ptr->line_pos++;
anchor_ptr->extent--;
- cur_shift++;
ch = UCH(line_ptr->data[anchor_ptr->line_pos]);
}
}
@@ -7107,7 +7105,7 @@ void HTCheckFnameForCompression(char **fname,
char *fn = *fname;
char *dot = NULL;
char *cp = NULL;
- const char *suffix = "";
+ const char *suffix;
CompressFileType method;
CompressFileType second;
@@ -11127,7 +11125,7 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc,
char *escaped1 = NULL;
char *escaped2 = NULL;
char *last_textarea_name = NULL;
- const char *name_used = "";
+ const char *name_used;
char *previous_blanks = NULL;
const char *val_used = "";
int anchor_count = 0;
@@ -13167,7 +13165,7 @@ static char *readEditedFile(char *ed_temp)
return ebuf;
}
-static int finish_ExtEditForm(LinkInfo * form_link, TextAnchor *start_anchor,
+static int finish_ExtEditForm(LinkInfo *form_link, TextAnchor *start_anchor,
char *ed_temp,
int orig_cnt)
{
@@ -13401,7 +13399,7 @@ static int finish_ExtEditForm(LinkInfo * form_link, TextAnchor *start_anchor,
*
* --KED 02/01/99
*/
-int HText_EditTextArea(LinkInfo * form_link)
+int HText_EditTextArea(LinkInfo *form_link)
{
char *ed_temp;
FILE *fp;
@@ -13494,7 +13492,7 @@ int HText_EditTextArea(LinkInfo * form_link)
/*
* Similar to HText_EditTextArea, but assume a single-line text field -TD
*/
-void HText_EditTextField(LinkInfo * form_link)
+void HText_EditTextField(LinkInfo *form_link)
{
char *ed_temp;
FILE *fp;
@@ -13556,7 +13554,7 @@ void HText_EditTextField(LinkInfo * form_link)
*
* --KED 02/14/99
*/
-void HText_ExpandTextarea(LinkInfo * form_link, int newlines)
+void HText_ExpandTextarea(LinkInfo *form_link, int newlines)
{
TextAnchor *anchor_ptr;
TextAnchor *end_anchor = NULL;
@@ -13639,7 +13637,7 @@ void HText_ExpandTextarea(LinkInfo * form_link, int newlines)
*
* --KED 02/21/99
*/
-int HText_InsertFile(LinkInfo * form_link)
+int HText_InsertFile(LinkInfo *form_link)
{
struct stat stat_info;
size_t size;
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 06a669a..b07aa92 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTFWriter.c,v 1.125 2023/11/05 23:46:45 tom Exp $
+ * $LynxId: HTFWriter.c,v 1.126 2024/04/11 20:21:33 tom Exp $
*
* FILE WRITER HTFWrite.h
* ===========
@@ -1121,7 +1121,7 @@ HTStream *HTCompressed(HTPresentation *pres,
Pnow = (HTPresentation *) HTList_objectAt(HTPresentations, i);
if (!strcasecomp(Pnow->rep->name, anchor->content_type) &&
Pnow->rep_out == WWW_PRESENT) {
- const char *program = "";
+ const char *program;
/*
* Pick the best presentation. User-defined mappings are at the
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index ee88cf9..fd77823 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYBookmark.c,v 1.88 2023/01/07 16:09:53 tom Exp $
+ * $LynxId: LYBookmark.c,v 1.92 2024/03/21 07:34:18 tom Exp $
*/
#include <HTUtils.h>
#include <HTAlert.h>
@@ -202,6 +202,159 @@ static char *title_convert8bit(const char *Title);
#define ftruncate(fd, len) _chsize(fd, len)
#endif
+static const char *visible_char(int ch)
+{
+ static char result[8];
+
+ if (ch < 32) {
+ sprintf(result, "^%c", ch | '@');
+ } else if (ch == 32) {
+ strcpy(result, "SP");
+ } else if (ch < 127) {
+ sprintf(result, "%c", ch);
+ } else if (ch == 127) {
+ strcpy(result, "DEL");
+ } else {
+ sprintf(result, "\\%03o", ch & 0xff);
+ }
+ return result;
+}
+
+typedef enum {
+ scanUnknown /* markup which we do not care about */
+ ,scanHeadOL
+ ,scanHeadUL
+ ,scanTailOL
+ ,scanTailUL
+ ,scanTailBody
+ ,scanTailHtml
+ ,scanIgnore /* whitespace */
+} SCAN_TRAILING;
+
+#define SCAN_LEN 10 /* longest interesting tag is 6 characters */
+
+/*
+ * Scan the bookmark file data, looking for a trailing "</ul>" or "</ol>".
+ * Keep track of "<ul> and "<ol>", and allow for comments.
+ */
+static int scan_trailing(FILE *ofp,
+ FILE *ifp,
+ char chunk[SCAN_LEN],
+ int *matched,
+ int *comment,
+ SCAN_TRAILING * scanned)
+{
+ /* *INDENT-OFF* */
+ static const struct {
+ SCAN_TRAILING code;
+ const char name[SCAN_LEN];
+ } table[] = {
+ { scanHeadOL, "<OL>" },
+ { scanHeadUL, "<UL>" },
+ { scanTailOL, "</OL>" },
+ { scanTailUL, "</UL>" },
+ { scanTailBody, "</BODY>" },
+ { scanTailHtml, "</HTML>" },
+ };
+ /* *INDENT-ON* */
+
+ int status = FALSE;
+ int ch = fgetc(ifp);
+
+ *scanned = scanUnknown;
+ if (!feof(ifp) && !ferror(ifp)) {
+ int uc = TOUPPER(ch);
+ int keep = FALSE;
+
+ if (isspace(UCH(uc)))
+ *scanned = scanIgnore;
+
+ switch (uc) {
+ case '<':
+ if (!*comment) {
+ *matched = 0;
+ keep = TRUE;
+ }
+ break;
+ case '!':
+ if (!*comment && *matched == 1) {
+ keep = TRUE;
+ } else
+ CTRACE((tfp, "...comment %d matched %d\n", *comment, *matched));
+ break;
+ case '-':
+ if (*comment) {
+ /* look for "-->" */
+ if (*matched == 0 || (*matched == 1 && chunk[0] == '-'))
+ keep = TRUE;
+ } else {
+ /* look for "<!--" */
+ if (*matched == 3) {
+ if (!strncmp(chunk, "<!-", 3)) {
+ *comment = TRUE;
+ keep = TRUE;
+ }
+ } else if (*matched == 2) {
+ keep = TRUE;
+ }
+ }
+ break;
+ case '>':
+ if (*comment) {
+ /* look for "-->" */
+ if ((*matched == 1 || *matched == 2) && chunk[0] == '-') {
+ *comment = FALSE;
+ keep = TRUE;
+ }
+ } else {
+ keep = TRUE;
+ }
+ break;
+ default:
+ if (isalpha(uc) || uc == '/') {
+ keep = !*comment;
+ } else {
+ keep = FALSE;
+ }
+ break;
+ }
+
+ if (keep) {
+ if (*matched < (SCAN_LEN - 2)) {
+ chunk[*matched] = (char) uc;
+ *matched += 1;
+ if (uc == '>') {
+ unsigned n;
+
+ chunk[*matched] = 0;
+ for (n = 0; n < TABLESIZE(table); ++n) {
+ if (!strcmp(chunk, table[n].name)) {
+ *scanned = table[n].code;
+ CTRACE2(TRACE_SGML, (tfp, "...matched '%s'\n",
+ chunk));
+ break;
+ }
+ }
+ }
+ } else {
+ *matched = 0;
+ }
+ } else {
+ *matched = 0;
+ }
+ chunk[*matched] = 0;
+
+ CTRACE2(TRACE_SGML, (tfp, "%s %s%s:%d:%s\n",
+ keep ? "KEEP" : "SKIP",
+ *comment ? "*" : "",
+ visible_char(uc), *matched, chunk));
+
+ fputc(ch, ofp);
+ status = TRUE;
+ }
+ return status;
+}
+
/*
* Adds a link to a bookmark file, creating the file if it doesn't already
* exist, and making sure that no_cache is set for a pre-existing, cached file,
@@ -217,6 +370,7 @@ void save_bookmark_link(const char *address,
char filename_buffer[LY_MAXPATH];
char *Address = NULL;
char *Title = NULL;
+ char *trailing_tag = NULL;
int i, c;
bstring *string_data = NULL;
bstring *tmp_data = NULL;
@@ -366,30 +520,123 @@ void save_bookmark_link(const char *address,
StrAllocCopy(Address, address);
LYEntify(&Address, FALSE);
+ /*
+ * Copy the existing bookmark file to a temporary file, to allow update.
+ */
if (!first_time) {
BOOLEAN empty_file = TRUE;
FILE *bp = tmpfile();
- char *buffer = NULL;
+ char chunk[SCAN_LEN];
+ int ch;
+ int offset_Chr = 0;
+ int offset_Tag = 0;
+ int limit_Edit = -1;
+ int last_OL = -1;
+ int last_UL = -1;
+ int count_OL = 0;
+ int count_UL = 0;
+ int matched = 0;
+ int comment = FALSE;
+ char found_tag[scanIgnore + 1];
+ SCAN_TRAILING scanned = scanUnknown;
rewind(fp);
- while (LYSafeGets(&buffer, fp)) {
+ memset(found_tag, 0, sizeof(found_tag));
+ while (scan_trailing(bp, fp, chunk, &matched, &comment, &scanned)) {
empty_file = FALSE;
- if (LYstrstr(buffer, "</ol>"))
+
+ /* remember where the most recent tag starts */
+ if (matched == 0)
+ offset_Tag = offset_Chr;
+
+ found_tag[scanned] = TRUE;
+ switch (scanned) {
+ case scanUnknown:
+ case scanIgnore:
+ break;
+ case scanHeadOL:
+ ++count_OL;
+ break;
+ case scanHeadUL:
+ ++count_UL;
+ break;
+ case scanTailOL:
+ count_OL--;
+ last_OL = offset_Tag;
break;
- fprintf(bp, "%s", buffer);
+ case scanTailUL:
+ count_UL--;
+ last_UL = offset_Tag;
+ break;
+ case scanTailBody:
+ case scanTailHtml:
+ if (limit_Edit < 0)
+ limit_Edit = offset_Tag;
+ break;
+ }
+
+ ++offset_Chr;
}
fflush(bp);
rewind(bp);
+ /* if no BODY/HTML tag ends the file, treat it as the whole file */
+ if (limit_Edit < 0)
+ limit_Edit = offset_Chr;
+
+ /* if the last UL/OL offsets differ, at least one is valid */
+ if (last_UL > last_OL) {
+ if (limit_Edit > last_UL)
+ limit_Edit = last_UL;
+ } else if (last_OL > last_UL) {
+ if (limit_Edit > last_OL)
+ limit_Edit = last_OL;
+ } else {
+ /* the initial file uses an ordered list; users may edit */
+ if (count_UL > count_OL)
+ StrAllocCopy(trailing_tag, "</ul>");
+ else
+ StrAllocCopy(trailing_tag, "</ol>");
+ }
+
+ if (TRACE) {
+ CTRACE((tfp, "Existing file length %d, insert at %d\n",
+ offset_Chr, limit_Edit));
+ if (limit_Edit == last_UL) {
+ CTRACE((tfp, "...insert before last </UL>: %d\n", last_UL));
+ } else if (limit_Edit == last_OL) {
+ CTRACE((tfp, "...insert before last </OL>: %d\n", last_OL));
+ } else if (trailing_tag != NULL) {
+ CTRACE((tfp, "...append with %s\n", trailing_tag));
+ }
+ }
+
rewind(fp);
- ftruncate(fileno(fp), 0);
+ if (ftruncate(fileno(fp), 0) == -1) {
+ CTRACE((tfp, "%s: %s\n", filename_buffer, strerror(errno)));
+ }
- while (LYSafeGets(&buffer, bp)) {
- fprintf(fp, "%s", buffer);
+ offset_Chr = 0;
+ while ((ch = fgetc(bp)) != EOF && !ferror(bp)) {
+ if (offset_Chr <= limit_Edit)
+ fputc(ch, fp);
+ else {
+ char buffer[2];
+
+ buffer[0] = (char) ch;
+ buffer[1] = 0;
+ StrAllocCat(trailing_tag, buffer);
+ }
+ ++offset_Chr;
}
fclose(bp);
+ if (!found_tag[scanTailBody])
+ StrAllocCat(trailing_tag, "</body>");
+ if (!found_tag[scanTailHtml])
+ StrAllocCat(trailing_tag, "</html>");
+
if (empty_file)
first_time = TRUE;
}
@@ -447,8 +694,10 @@ Note: if you edit this file manually\n\
fprintf(fp, "%s %s%s\n", Address, TimeString, Title);
} else {
fprintf(fp, "<li><a href=\"%s\">%s</a></li>\n", Address, Title);
- fprintf(fp, "</ol></body></html>\n");
+ if (trailing_tag != NULL)
+ fputs(trailing_tag, fp);
}
+ free(trailing_tag);
LYCloseOutput(fp);
SetDefaultMode(O_BINARY);
@@ -1029,6 +1278,7 @@ static BOOLEAN havevisible(const char *Title)
unsigned char c;
long unicode;
+ UCTransToUni(0, -1); /* reset internal state */
for (; *p; p++) {
c = UCH(TOASCII(*p));
if (c > 32 && c < 127) {
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index 94b7a04..f5f1633 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYCharSets.c,v 1.71 2021/06/29 22:01:12 tom Exp $
+ * $LynxId: LYCharSets.c,v 1.74 2024/03/15 16:15:07 tom Exp $
*/
#include <HTUtils.h>
#include <HTCJK.h>
@@ -605,34 +605,15 @@ static void HTMLSetDisplayCharsetMatchLocale(int i)
* We have no intention to pass CJK via UCTransChar if that happened.
* Let someone from CJK correct this if necessary.
*/
- DisplayCharsetMatchLocale = TRUE; /* old-style */
- return;
-
- } else if (strncasecomp(LYCharSet_UC[i].MIMEname, "cp", 2) ||
- strncasecomp(LYCharSet_UC[i].MIMEname, "windows", 7)) {
- /*
- * Assume dos/windows displays usually on remote terminal, hence it
- * rarely matches locale. (In fact, MS Windows codepoints locale are
- * never seen on UNIX).
- */
- match = FALSE;
+ match = TRUE; /* old-style */
+ } else if (!strncasecomp(LYCharSet_UC[i].MIMEname, "cp", 2) ||
+ !strncasecomp(LYCharSet_UC[i].MIMEname, "windows", 7)) {
+ match = FALSE; /* Windows locale is never seen on UNIX */
} else {
- match = TRUE; /* guess, but see below */
-
-#if !defined(LOCALE)
- if (LYCharSet_UC[i].enc != UCT_ENC_UTF8)
- /*
- * Leave true for utf-8 display - the code doesn't deal very well
- * with this case. - kw
- */
- match = FALSE;
+#if defined(LOCALE)
+ match = !UCForce8bitTOUPPER; /* disable locale (from lynx.cfg) */
#else
- if (UCForce8bitTOUPPER) {
- /*
- * Force disable locale (from lynx.cfg)
- */
- match = FALSE;
- }
+ match = (LYCharSet_UC[i].enc == UCT_ENC_UTF8);
#endif
}
diff --git a/src/LYIcon.rc b/src/LYIcon.rc
index 001af56..3076d34 100644
--- a/src/LYIcon.rc
+++ b/src/LYIcon.rc
@@ -1,12 +1,12 @@
-// $LynxId: LYIcon.rc,v 1.57 2024/01/07 11:13:00 tom Exp $
+// $LynxId: LYIcon.rc,v 1.66 2024/04/15 20:53:51 tom Exp $
#include <windows.h>
100 ICON "../samples/lynx.ico"
VS_VERSION_INFO VERSIONINFO
-FILEVERSION 2,9,0,1013
-PRODUCTVERSION 2,9,0,1013
+FILEVERSION 2,9,1,0
+PRODUCTVERSION 2,9,1,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
@@ -19,12 +19,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "https://invisible-island.net/lynx"
VALUE "FileDescription", "Lynx - web browser"
- VALUE "FileVersion", "2.9.0.1013"
+ VALUE "FileVersion", "2.9.1.0"
VALUE "InternalName", "Lynx"
VALUE "LegalCopyright", "©1997-2024 Thomas E. Dickey"
VALUE "OriginalFilename", "lynx.exe"
VALUE "ProductName", "Lynx - web browser"
- VALUE "ProductVersion", "2.9.0.1013"
+ VALUE "ProductVersion", "2.9.1.0"
END
END
BLOCK "VarFileInfo"
diff --git a/src/LYMain.c b/src/LYMain.c
index ab48cae..1d52bb6 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYMain.c,v 1.300 2024/01/07 15:31:25 tom Exp $
+ * $LynxId: LYMain.c,v 1.301 2024/03/17 23:10:41 tom Exp $
*/
#include <HTUtils.h>
#include <HTTP.h>
@@ -1003,7 +1003,7 @@ static void append_ssl_version(char **target,
/* Set the text message domain. */
void LYSetTextDomain(void)
{
-#if defined(HAVE_LIBINTL_H) || defined(HAVE_LIBGETTEXT_H)
+#if defined(HAVE_LIBINTL_H)
const char *cp;
if ((cp = LYGetEnv("LYNX_LOCALEDIR")) == 0) {
@@ -1221,6 +1221,7 @@ int main(int argc,
* Zero the links and history struct arrays.
*/
memset((void *) links, 0, sizeof(LinkInfo) * MAXLINKS);
+
LYAllocHistory(8);
/*
* Zero the MultiBookmark arrays.
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 55be205..b5c7ab8 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYMainLoop.c,v 1.254 2024/01/15 19:10:04 Gisle.Vanem Exp $
+ * $LynxId: LYMainLoop.c,v 1.256 2024/04/11 21:53:34 tom Exp $
*/
#include <HTUtils.h>
#include <HTAccess.h>
@@ -177,7 +177,7 @@ HTAtom *WWW_SOURCE = 0;
static void exit_immediately_with_error_message(int state, int first_file);
static void status_link(const char *curlink_name, int show_more, int show_indx);
-static void show_main_statusline(const LinkInfo curlink, int for_what);
+static void show_main_statusline(const LinkInfo *curlink, int for_what);
static void form_noviceline(int);
static int are_different(DocInfo *doc1, DocInfo *doc2);
@@ -1061,7 +1061,7 @@ static int handle_LYK_ACTIVATE(int *c,
F_TEXTLIKE(links[curdoc.link].l_form->type)) {
textinput_activated = TRUE;
- show_main_statusline(links[curdoc.link], FOR_INPUT);
+ show_main_statusline(&links[curdoc.link], FOR_INPUT);
textfields_need_activation = textfields_activation_option;
return 0;
@@ -6769,8 +6769,8 @@ int mainloop(void)
* If help is not on the screen, then put a message on the screen to
* tell the user other misc info.
*/
- if (!show_help && curdoc.link >= 0) {
- show_main_statusline(links[curdoc.link],
+ if (!show_help) {
+ show_main_statusline(curdoc.link >= 0 ? &links[curdoc.link] : NULL,
((curlink_is_editable &&
textinput_activated)
? FOR_INPUT
@@ -7109,13 +7109,13 @@ int mainloop(void)
#ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
if (textfields_need_activation) {
- show_main_statusline(links[curdoc.link], FOR_PANEL);
+ show_main_statusline(&links[curdoc.link], FOR_PANEL);
#ifdef INACTIVE_INPUT_STYLE_VH
textinput_redrawn = FALSE;
#endif
} else
#endif
- show_main_statusline(links[curdoc.link], FOR_INPUT);
+ show_main_statusline(&links[curdoc.link], FOR_INPUT);
} else if (more_text) {
HTInfoMsg(MOREHELP);
} else {
@@ -7745,6 +7745,8 @@ int mainloop(void)
if (handle_LYK_LINEWRAP_TOGGLE(&cmd, &refresh_screen))
goto new_cmd;
break;
+#else
+ (void) key_count;
#endif
#ifdef USE_MAXSCREEN_TOGGLE
@@ -7930,7 +7932,7 @@ void HTAddGotoURL(char *url)
* When help is not on the screen, put a message on the screen to tell the user
* other misc info.
*/
-static void show_main_statusline(const LinkInfo curlink,
+static void show_main_statusline(const LinkInfo *curlink,
int for_what)
{
/*
@@ -7954,16 +7956,16 @@ static void show_main_statusline(const LinkInfo curlink,
} else if (lynx_mode == FORMS_LYNX_MODE && nlinks > 0) {
#else
#ifdef NORMAL_NON_FORM_LINK_STATUSLINES_FOR_ALL_USER_MODES
- } else if (lynx_mode == FORMS_LYNX_MODE && nlinks > 0 &&
- !(curlink.type & WWW_LINK_TYPE)) {
+ } else if (lynx_mode == FORMS_LYNX_MODE && nlinks > 0 && curlink &&
+ !(curlink->type & WWW_LINK_TYPE)) {
#else
- } else if (lynx_mode == FORMS_LYNX_MODE && nlinks > 0 &&
+ } else if (lynx_mode == FORMS_LYNX_MODE && nlinks > 0 && curlink &&
!((user_mode == ADVANCED_MODE || user_mode == MINIMAL_MODE) &&
- (curlink.type & WWW_LINK_TYPE))) {
+ (curlink->type & WWW_LINK_TYPE))) {
#endif /* NORMAL_NON_FORM_LINK_STATUSLINES_FOR_ALL_USER_MODES */
#endif /* INDICATE_FORMS_MODE_FOR_ALL_LINKS_ON_PAGE */
- if (curlink.type == WWW_FORM_LINK_TYPE) {
- show_formlink_statusline(curlink.l_form, for_what);
+ if (curlink->type == WWW_FORM_LINK_TYPE) {
+ show_formlink_statusline(curlink->l_form, for_what);
} else {
statusline(NORMAL_LINK_MESSAGE);
}
@@ -7980,18 +7982,18 @@ static void show_main_statusline(const LinkInfo curlink,
lynx_stop_reverse();
}
- } else if ((user_mode == ADVANCED_MODE) && nlinks > 0) {
+ } else if ((user_mode == ADVANCED_MODE) && nlinks > 0 && curlink) {
/*
* Show the URL or, for some internal links, the fragment
*/
char *cp = NULL;
- if (curlink.type == WWW_INTERN_LINK_TYPE &&
- !isLYNXIMGMAP(curlink.lname)) {
- cp = findPoundSelector(curlink.lname);
+ if (curlink->type == WWW_INTERN_LINK_TYPE &&
+ !isLYNXIMGMAP(curlink->lname)) {
+ cp = findPoundSelector(curlink->lname);
}
if (!cp)
- cp = curlink.lname;
+ cp = curlink->lname;
status_link(cp, more_text, is_www_index);
} else if ((user_mode == MINIMAL_MODE) && nlinks > 0) {
/*
@@ -8037,7 +8039,7 @@ static void show_main_statusline(const LinkInfo curlink,
void repaint_main_statusline(int for_what)
{
if (curdoc.link >= 0 && curdoc.link < nlinks)
- show_main_statusline(links[curdoc.link], for_what);
+ show_main_statusline(&links[curdoc.link], for_what);
}
static void form_noviceline(int disabled)
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index e4ab796..24efbf5 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYReadCFG.c,v 1.200 2021/07/29 22:52:55 tom Exp $
+ * $LynxId: LYReadCFG.c,v 1.201 2024/03/17 23:04:33 tom Exp $
*/
#ifndef NO_RULES
#include <HTRules.h>
@@ -1406,7 +1406,7 @@ static int screen_size_fun(char *value)
}
#endif
-#if defined(HAVE_LIBINTL_H) || defined(HAVE_LIBGETTEXT_H)
+#if defined(HAVE_LIBINTL_H)
static int message_language_fun(char *value)
{
char *tmp = NULL;
@@ -1621,7 +1621,7 @@ static Config_Type Config_Table [] =
PARSE_INT(RC_MAX_COOKIES_GLOBAL, max_cookies_global),
PARSE_INT(RC_MAX_URI_SIZE, max_uri_size),
PARSE_TIM(RC_MESSAGESECS, MessageSecs),
-#if defined(HAVE_LIBINTL_H) || defined(HAVE_LIBGETTEXT_H)
+#if defined(HAVE_LIBINTL_H)
PARSE_FUN(RC_MESSAGE_LANGUAGE, message_language_fun),
#endif
PARSE_SET(RC_MINIMAL_COMMENTS, minimal_comments),
diff --git a/src/TRSTable.c b/src/TRSTable.c
index 4123596..1d7a4ec 100644
--- a/src/TRSTable.c
+++ b/src/TRSTable.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: TRSTable.c,v 1.43 2023/11/10 01:01:54 tom Exp $
+ * $LynxId: TRSTable.c,v 1.45 2024/04/11 20:41:16 tom Exp $
* Simple table object
* ===================
* Authors
@@ -205,9 +205,10 @@ static int Stbl_finishRowInTable(STable_info *me);
static const char *cellstate_s(cellstate_t state)
{
- const char *result = "?";
+ const char *result;
/* *INDENT-OFF* */
switch (state) {
+ default:
case CS_invalid: result = "CS_invalid"; break;
case CS__new: result = "CS__new"; break;
case CS__0new: result = "CS__0new"; break;
diff --git a/src/chrtrans/README.tables b/src/chrtrans/README.tables
index 14431da..911d795 100644
--- a/src/chrtrans/README.tables
+++ b/src/chrtrans/README.tables
@@ -71,6 +71,6 @@ Lynx, a `make clean' should not be necessary if you have *only* made
changes to the files in src/chrtrans. On VMS, add entries for new
tables to build-chrtrans.com, but you can update the particular file
with build-header.com, then use the top directory's build.com and
-answer 'n' to it's prompts about whether to update the WWWlibrary
+answer 'n' to its prompts about whether to update the WWW library
and chrtrans modules.
diff --git a/src/makefile.in b/src/makefile.in
index 5246226..add3faa 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -1,4 +1,4 @@
-# $LynxId: makefile.in,v 1.77 2021/02/28 15:56:53 tom Exp $
+# $LynxId: makefile.in,v 1.80 2024/04/03 23:50:55 tom Exp $
# template-makefile for Lynx src directory
SHELL = @CONFIG_SHELL@
@@ -10,7 +10,7 @@ datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
-VPATH = .:$(srcdir)
+VPATH = $(srcdir)
top_builddir = ..
@@ -53,9 +53,6 @@ WAISLIB = # FIXME: set in parent makefile
WWWINC = WWW/Library/Implementation
WWWLIB = $(top_builddir)/WWW/Library/Implementation/libwww.a
-INTLLIB = @INTLLIBS@
-INTLDIR_CPPFLAGS= @INTLDIR_CPPFLAGS@-I$(top_srcdir)/intl
-
CPP_OPTS = $(DEFS) $(CHARSET_DEFS) \
-DLOCALEDIR=\"$(localedir)\" \
-I. \
@@ -65,7 +62,7 @@ CPP_OPTS = $(DEFS) $(CHARSET_DEFS) \
-I$(top_srcdir) \
-I$(top_srcdir)/src \
-I$(top_srcdir)/$(WWWINC) \
- $(INTLDIR_CPPFLAGS) $(SITE_DEFS) $(CPPFLAGS)
+ $(SITE_DEFS) $(CPPFLAGS)
CC_OPTS = $(CFLAGS) $(CPP_OPTS)
LINT = @LINT@
@@ -107,7 +104,7 @@ all: lynx$x
lynx$x: message $(top_builddir)/LYHelp.h $(OBJS) $(WWWLIB)
@echo "Linking and creating Lynx executable"
- $(CC) $(CC_OPTS) $(LDFLAGS) -o $@ $(OBJS) $(WWWLIB) $(LIBS) $(INTLLIB)
+ $(CC) $(CC_OPTS) $(LDFLAGS) -o $@ $(OBJS) $(WWWLIB) $(LIBS)
@echo "Copying Lynx executable into top-level directory"
rm -f $(top_builddir)/$@
cp $@ $(top_builddir)/