about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES5
-rw-r--r--WWW/Library/Implementation/HTParse.c6
-rw-r--r--WWW/Library/Implementation/HTStyle.c13
-rw-r--r--WWW/Library/Implementation/HTStyle.h26
-rw-r--r--src/DefaultStyle.c559
-rw-r--r--src/GridText.c6
-rw-r--r--src/HTML.c18
-rw-r--r--src/LYCurses.c6
-rw-r--r--src/LYCurses.h6
-rw-r--r--src/LYReadCFG.c57
-rw-r--r--src/LYReadCFG.h7
-rw-r--r--src/LYStyle.c53
-rw-r--r--src/LYrcFile.c4
-rw-r--r--src/LYrcFile.h4
14 files changed, 411 insertions, 359 deletions
diff --git a/CHANGES b/CHANGES
index 9e1df4c8..52aa768b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,11 @@
--- $LynxId: CHANGES,v 1.460 2009/11/25 10:31:39 tom Exp $
+-- $LynxId: CHANGES,v 1.461 2009/11/27 15:27:35 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
+2009-12-?? (2.8.8dev.3)
+* fix most gcc writable-strings warnings -TD
+
 2009-11-25 (2.8.8dev.2)
 * modify trimming of URI in LYSetCookie() to eliminate trimming of final leaf
   (Debian #460108) -TD
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index 4c2a63bc..c14cc6f7 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTParse.c,v 1.53 2009/09/06 18:18:06 tom Exp $
+ * $LynxId: HTParse.c,v 1.54 2009/11/27 13:11:30 tom Exp $
  *
  *		Parse HyperText Document Address		HTParse.c
  *		================================
@@ -271,9 +271,9 @@ static void convert_to_idna(char *host)
 		int hi = hex_decode(*src++);
 		int lo = hex_decode(*src++);
 
-		*dst = (hi << 4) | lo;
+		*dst = (char) ((hi << 4) | lo);
 	    } else {
-		*dst = ch;
+		*dst = (char) ch;
 	    }
 	}
 	*dst = '\0';
diff --git a/WWW/Library/Implementation/HTStyle.c b/WWW/Library/Implementation/HTStyle.c
index 125c13c9..54c0bc52 100644
--- a/WWW/Library/Implementation/HTStyle.c
+++ b/WWW/Library/Implementation/HTStyle.c
@@ -1,4 +1,7 @@
-/*	Style Implementation for Hypertext			HTStyle.c
+/*
+ * $LynxId: HTStyle.c,v 1.16 2009/11/27 13:01:48 tom Exp $
+ *
+ *	Style Implementation for Hypertext			HTStyle.c
  *	==================================
  *
  *	Styles allow the translation between a logical property
@@ -31,7 +34,7 @@ HTStyle *HTStyleNewNamed(const char *name)
 {
     HTStyle *self = HTStyleNew();
 
-    StrAllocCopy(self->name, name);
+    StrAllocCopy(self->w_name, name);
     self->id = -1;		/* <0 */
     return self;
 }
@@ -40,8 +43,8 @@ HTStyle *HTStyleNewNamed(const char *name)
 */
 HTStyle *HTStyleFree(HTStyle *self)
 {
-    FREE(self->name);
-    FREE(self->SGMLTag);
+    FREE(self->w_name);
+    FREE(self->w_SGMLTag);
     FREE(self);
     return NULL;
 }
@@ -185,7 +188,7 @@ HTStyle *HTStyleNamed(HTStyleSheet *self, const char *name)
     HTStyle *scan;
 
     for (scan = self->styles; scan; scan = scan->next)
-	if (0 == strcmp(scan->name, name))
+	if (0 == strcmp(GetHTStyleName(scan), name))
 	    return scan;
     CTRACE((tfp, "StyleSheet: No style named `%s'\n", name));
     return NULL;
diff --git a/WWW/Library/Implementation/HTStyle.h b/WWW/Library/Implementation/HTStyle.h
index 550a7a06..2e64d727 100644
--- a/WWW/Library/Implementation/HTStyle.h
+++ b/WWW/Library/Implementation/HTStyle.h
@@ -1,4 +1,6 @@
-/*                                                       HTStyle: Style management for libwww
+/*
+ * $LynxId: HTStyle.h,v 1.16 2009/11/27 13:07:57 tom Exp $
+					    HTStyle: Style management for libwww
                               STYLE DEFINITION FOR HYPERTEXT
 
    Styles allow the translation between a logical property of a piece of text
@@ -80,9 +82,11 @@ extern "C" {
 /*      Style management information
 */
 	struct _HTStyle *next;	/* Link for putting into stylesheet */
-	char *name;		/* Style name */
+	char *w_name;		/* Style name */
+	const char *c_name;	/* Style name */
 	int id;			/* equivalent of name, for speed */
-	char *SGMLTag;		/* Tag name to start */
+	char *w_SGMLTag;	/* Tag name to start */
+	const char *c_SGMLTag;	/* Tag name to start */
 
 /*      Character attributes    (a la NXRun)
 */
@@ -120,6 +124,22 @@ extern "C" {
 
     } HTStyle;
 
+#define GetHTStyleName(p) ((p)->w_name    ? (p)->w_name    : (p)->c_name)
+#define GetHTStyleSGML(p) ((p)->w_SGMLTag ? (p)->w_SGMLTag : (p)->c_SGMLTag)
+
+#define HTStyleInit( \
+	next, name, SGML_tag, \
+	font, fontsize, color, superscript, \
+	anchor, indent1st, leftIndent, rightIndent, \
+	alignment, lineHt, descentLine, \
+	tabs, wordWrap, freeFormat, spaceBefore, spaceAfter, paraFlags) \
+    { \
+	next, NULL, #name, ST_##name, NULL, SGML_tag, \
+	font, fontsize, color, superscript, \
+	anchor, indent1st, leftIndent, rightIndent, \
+	alignment, lineHt, descentLine, \
+	tabs, wordWrap, freeFormat, spaceBefore, spaceAfter, paraFlags }
+
 #define HT_ALIGN_NONE (-1)
 
 /*      Style functions:
diff --git a/src/DefaultStyle.c b/src/DefaultStyle.c
index f1716e9c..3dc17f75 100644
--- a/src/DefaultStyle.c
+++ b/src/DefaultStyle.c
@@ -1,4 +1,7 @@
-/*	A real style sheet for the Character Grid browser
+/*
+ * $LynxId: DefaultStyle.c,v 1.20 2009/11/27 13:04:27 tom Exp $
+ *
+ *	A real style sheet for the Character Grid browser
  *
  *	The dimensions are all in characters!
  */
@@ -47,377 +50,385 @@ static const HTTabStop tabs_8[] =
  */
 
 static HTStyle HTStyleNormal =
-{
-    0, "Normal", ST_Normal, "P",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 3, 6, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       0, Normal, "P",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 3, 6, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleDivCenter =
-{
-    &HTStyleNormal, "DivCenter", ST_DivCenter, "DCENTER",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 3, 6, HT_CENTER, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleNormal, DivCenter, "DCENTER",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 3, 6, HT_CENTER, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleDivLeft =
-{
-    &HTStyleDivCenter, "DivLeft", ST_DivLeft, "DLEFT",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 3, 6, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleDivCenter, DivLeft, "DLEFT",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 3, 6, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleDivRight =
-{
-    &HTStyleDivLeft, "DivRight", ST_DivRight, "DRIGHT",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 3, 6, HT_RIGHT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleDivLeft, DivRight, "DRIGHT",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 3, 6, HT_RIGHT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleBanner =
-{
-    &HTStyleDivRight, "Banner", ST_Banner, "BANNER",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 3, 6, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleDivRight, Banner, "BANNER",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 3, 6, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleBlockquote =
-{
-    &HTStyleBanner, "Blockquote", ST_Blockquote, "BLOCKQUOTE",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    5, 5, 7, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleBanner, Blockquote, "BLOCKQUOTE",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleBq =
-{				/* HTML 3.0 BLOCKQUOTE - FM */
-    &HTStyleBlockquote, "Bq", ST_Bq, "BQ",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    5, 5, 7, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(			/* HTML 3.0 BLOCKQUOTE - FM */
+	       &HTStyleBlockquote, Bq, "BQ",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleFootnote =
-{				/* HTML 3.0 FN - FM */
-    &HTStyleBq, "Footnote", ST_Footnote, "FN",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    5, 5, 7, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(			/* HTML 3.0 FN - FM */
+	       &HTStyleBq, Footnote, "FN",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleList =
-{
-    &HTStyleFootnote, "List", ST_List, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 7, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleFootnote, List, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 7, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleList1 =
-{
-    &HTStyleList, "List1", ST_List1, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    8, 12, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleList, List1, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       8, 12, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleList2 =
-{
-    &HTStyleList1, "List2", ST_List2, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    13, 17, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleList1, List2, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       13, 17, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleList3 =
-{
-    &HTStyleList2, "List3", ST_List3, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    18, 22, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleList2, List3, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       18, 22, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleList4 =
-{
-    &HTStyleList3, "List4", ST_List4, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    23, 27, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleList3, List4, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       23, 27, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleList5 =
-{
-    &HTStyleList4, "List5", ST_List5, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    28, 32, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleList4, List5, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       28, 32, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleList6 =
-{
-    &HTStyleList5, "List6", ST_List6, "UL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    33, 37, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0};
+HTStyleInit(
+	       &HTStyleList5, List6, "UL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       33, 37, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0);
 
 static HTStyle HTStyleMenu =
-{
-    &HTStyleList6, "Menu", ST_Menu, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 7, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleList6, Menu, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 7, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleMenu1 =
-{
-    &HTStyleMenu, "Menu1", ST_Menu1, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    8, 12, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleMenu, Menu1, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       8, 12, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleMenu2 =
-{
-    &HTStyleMenu1, "Menu2", ST_Menu2, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    13, 17, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleMenu1, Menu2, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       13, 17, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleMenu3 =
-{
-    &HTStyleMenu2, "Menu3", ST_Menu3, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    18, 22, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleMenu2, Menu3, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       18, 22, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleMenu4 =
-{
-    &HTStyleMenu3, "Menu4", ST_Menu4, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    23, 27, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleMenu3, Menu4, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       23, 27, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleMenu5 =
-{
-    &HTStyleMenu4, "Menu5", ST_Menu5, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    28, 33, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleMenu4, Menu5, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       28, 33, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleMenu6 =
-{
-    &HTStyleMenu5, "Menu6", ST_Menu6, "MENU",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    33, 38, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleMenu5, Menu6, "MENU",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       33, 38, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossary =
-{
-    &HTStyleMenu6, "Glossary", ST_Glossary, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 10, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleMenu6, Glossary, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 10, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossary1 =
-{
-    &HTStyleGlossary, "Glossary1", ST_Glossary1, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    8, 16, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary, Glossary1, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       8, 16, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossary2 =
-{
-    &HTStyleGlossary1, "Glossary2", ST_Glossary2, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    14, 22, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary1, Glossary2, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       14, 22, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossary3 =
-{
-    &HTStyleGlossary2, "Glossary3", ST_Glossary3, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    20, 28, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary2, Glossary3, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       20, 28, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossary4 =
-{
-    &HTStyleGlossary3, "Glossary4", ST_Glossary4, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    26, 34, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary3, Glossary4, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       26, 34, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossary5 =
-{
-    &HTStyleGlossary4, "Glossary5", ST_Glossary5, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    32, 40, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary4, Glossary5, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       32, 40, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossary6 =
-{
-    &HTStyleGlossary5, "Glossary6", ST_Glossary6, "DL",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    38, 46, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary5, Glossary6, "DL",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       38, 46, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0
+);
 
 static HTStyle HTStyleGlossaryCompact =
-{
-    &HTStyleGlossary6, "GlossaryCompact", ST_GlossaryCompact, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    3, 10, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossary6, GlossaryCompact, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       3, 10, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossaryCompact1 =
-{
-    &HTStyleGlossaryCompact, "GlossaryCompact1", ST_GlossaryCompact1, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    8, 15, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact,
+	       GlossaryCompact1, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       8, 15, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossaryCompact2 =
-{
-    &HTStyleGlossaryCompact1, "GlossaryCompact2", ST_GlossaryCompact2, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    13, 20, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact1,
+	       GlossaryCompact2, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       13, 20, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossaryCompact3 =
-{
-    &HTStyleGlossaryCompact2, "GlossaryCompact3", ST_GlossaryCompact3, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    18, 25, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact2,
+	       GlossaryCompact3, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       18, 25, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossaryCompact4 =
-{
-    &HTStyleGlossaryCompact3, "GlossaryCompact4", ST_GlossaryCompact4, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    23, 30, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact3,
+	       GlossaryCompact4, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       23, 30, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossaryCompact5 =
-{
-    &HTStyleGlossaryCompact4, "GlossaryCompact5", ST_GlossaryCompact5, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    28, 35, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact4,
+	       GlossaryCompact5, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       28, 35, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleGlossaryCompact6 =
-{
-    &HTStyleGlossaryCompact5, "GlossaryCompact6", ST_GlossaryCompact6, "DLC",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    33, 40, 6, HT_LEFT, 1, 0, 0,
-    YES, YES, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact5,
+	       GlossaryCompact6, "DLC",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       33, 40, 6, HT_LEFT, 1, 0, 0,
+	       YES, YES, 0, 0, 0
+);
 
 static HTStyle HTStyleExample =
-{
-    &HTStyleGlossaryCompact6, "Example", ST_Example, "XMP",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    0, 0, 0, HT_LEFT, 1, 0, tabs_8,
-    NO, NO, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleGlossaryCompact6,
+	       Example, "XMP",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       0, 0, 0, HT_LEFT, 1, 0, tabs_8,
+	       NO, NO, 0, 0, 0
+);
 
 static HTStyle HTStylePreformatted =
-{
-    &HTStyleExample, "Preformatted", ST_Preformatted, "PRE",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    0, 0, 0, HT_LEFT, 1, 0, tabs_8,
-    NO, NO, 0, 0, 0
-};
+HTStyleInit(
+	       &HTStyleExample,
+	       Preformatted, "PRE",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       0, 0, 0, HT_LEFT, 1, 0, tabs_8,
+	       NO, NO, 0, 0, 0
+);
 
 static HTStyle HTStyleListing =
-{
-    &HTStylePreformatted, "Listing", ST_Listing, "LISTING",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    0, 0, 0, HT_LEFT, 1, 0, tabs_8,
-    NO, NO, 0, 0, 0};
+HTStyleInit(
+	       &HTStylePreformatted, Listing, "LISTING",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       0, 0, 0, HT_LEFT, 1, 0, tabs_8,
+	       NO, NO, 0, 0, 0);
 
 static HTStyle HTStyleAddress =
-{
-    &HTStyleListing, "Address", ST_Address, "ADDRESS",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    4, 4, 7, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 2, 0, 0};
+HTStyleInit(
+	       &HTStyleListing, Address, "ADDRESS",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       4, 4, 7, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 2, 0, 0);
 
 static HTStyle HTStyleNote =
-{				/* HTML 3.0 NOTE - FM */
-    &HTStyleAddress, "Note", ST_Note, "NOTE",
-    HT_FONT, 1, HT_BLACK, 0, 0,
-    5, 5, 7, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(			/* HTML 3.0 NOTE - FM */
+	       &HTStyleAddress, Note, "NOTE",
+	       HT_FONT, 1, HT_BLACK, 0, 0,
+	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeading1 =
-{
-    &HTStyleNote, "Heading1", ST_Heading1, "H1",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    0, 0, 0, HT_CENTER, 1, 0, 0,
-    YES, YES, 1, 1, 0};
+HTStyleInit(
+	       &HTStyleNote, Heading1, "H1",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       0, 0, 0, HT_CENTER, 1, 0, 0,
+	       YES, YES, 1, 1, 0);
 
 static HTStyle HTStyleHeading2 =
-{
-    &HTStyleHeading1, "Heading2", ST_Heading2, "H2",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    0, 0, 0, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 1, 0};
+HTStyleInit(
+	       &HTStyleHeading1, Heading2, "H2",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       0, 0, 0, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 1, 0);
 
 static HTStyle HTStyleHeading3 =
-{
-    &HTStyleHeading2, "Heading3", ST_Heading3, "H3",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    2, 2, 0, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeading2, Heading3, "H3",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       2, 2, 0, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeading4 =
-{
-    &HTStyleHeading3, "Heading4", ST_Heading4, "H4",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    4, 4, 0, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeading3, Heading4, "H4",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       4, 4, 0, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeading5 =
-{
-    &HTStyleHeading4, "Heading5", ST_Heading5, "H5",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    6, 6, 0, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeading4, Heading5, "H5",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       6, 6, 0, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeading6 =
-{
-    &HTStyleHeading5, "Heading6", ST_Heading6, "H6",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    8, 8, 0, HT_LEFT, 1, 0, 0,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeading5, Heading6, "H6",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       8, 8, 0, HT_LEFT, 1, 0, 0,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeadingCenter =
-{
-    &HTStyleHeading6, "HeadingCenter", ST_HeadingCenter, "HCENTER",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    0, 0, 3, HT_CENTER, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeading6, HeadingCenter, "HCENTER",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       0, 0, 3, HT_CENTER, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeadingLeft =
-{
-    &HTStyleHeadingCenter, "HeadingLeft", ST_HeadingLeft, "HLEFT",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    0, 0, 3, HT_LEFT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeadingCenter, HeadingLeft, "HLEFT",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       0, 0, 3, HT_LEFT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 static HTStyle HTStyleHeadingRight =
-{
-    &HTStyleHeadingLeft, "HeadingRight", ST_HeadingRight, "HRIGHT",
-    HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
-    0, 0, 3, HT_RIGHT, 1, 0, tabs_8,
-    YES, YES, 1, 0, 0};
+HTStyleInit(
+	       &HTStyleHeadingLeft, HeadingRight, "HRIGHT",
+	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
+	       0, 0, 3, HT_RIGHT, 1, 0, tabs_8,
+	       YES, YES, 1, 0, 0);
 
 /* Style sheet points to the last in the list:
 */
diff --git a/src/GridText.c b/src/GridText.c
index d57d4364..4b2b763d 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: GridText.c,v 1.174 2009/11/21 17:05:33 Bela.Lubkin Exp $
+ * $LynxId: GridText.c,v 1.176 2009/11/27 13:18:18 tom Exp $
  *
  *		Character grid hypertext object
  *		===============================
@@ -605,7 +605,7 @@ static int utfxtra_on_this_line = 0;	/* num of UTF-8 extra bytes in line,
 #endif
 
 static HTStyle default_style =
-{0, "(Unstyled)", 0, "",
+{0, NULL, "(Unstyled)", 0, NULL, "",
  (HTFont) 0, 1, HT_BLACK, 0, 0,
  0, 0, 0, HT_LEFT, 1, 0, 0,
  NO, NO, 0, 0, 0};
@@ -3582,7 +3582,7 @@ void HText_setStyle(HText *text, HTStyle *style)
     after = text->style->spaceAfter;
     before = style->spaceBefore;
 
-    CTRACE((tfp, "GridText: Change to style %s\n", style->name));
+    CTRACE((tfp, "GridText: Change to style %s\n", GetHTStyleName(style)));
 
     blank_lines(text, ((after > before) ? after : before));
 
diff --git a/src/HTML.c b/src/HTML.c
index bb7e2025..2f79b571 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTML.c,v 1.132 2009/11/21 17:05:33 Bela.Lubkin Exp $
+ * $LynxId: HTML.c,v 1.133 2009/11/27 12:47:31 tom Exp $
  *
  *		Structured stream to Rich hypertext converter
  *		============================================
@@ -5542,7 +5542,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
 	if (me->skip_stack > 0) {
 	    CTRACE((tfp,
 		    "HTML:begin_element: internal call (level %d), leaving on stack - `%s'\n",
-		    me->skip_stack, NONNULL(me->sp->style->name)));
+		    me->skip_stack, NONNULL(GetHTStyleName(me->sp->style))));
 	    me->skip_stack--;
 	    return status;
 	}
@@ -5560,7 +5560,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
 	CTRACE((tfp,
 		"HTML:begin_element[%d]: adding style to stack - %s (%s)\n",
 		(int) STACKLEVEL(me),
-		NONNULL(me->new_style->name),
+		NONNULL(GetHTStyleName(me->new_style)),
 		HTML_dtd.tags[ElementNumber].name));
 	(me->sp)--;
 	me->sp[0].style = me->new_style;	/* Stack new style */
@@ -5712,7 +5712,7 @@ static int HTML_end_element(HTStructured * me, int element_number,
 	    CTRACE2(TRACE_STYLE,
 		    (tfp,
 		     "HTML:end_element: Internal call (level %d), leaving on stack - %s\n",
-		     me->skip_stack, NONNULL(me->sp->style->name)));
+		     me->skip_stack, NONNULL(GetHTStyleName(me->sp->style))));
 	    me->skip_stack--;
 	} else if (element_number == HTML_OBJECT &&
 		   me->sp[0].tag_number != HTML_OBJECT &&
@@ -5730,7 +5730,7 @@ static int HTML_end_element(HTStructured * me, int element_number,
 		     (int) STACKLEVEL(me),
 		     "Special OBJECT handling", me->objects_mixed_open,
 		     "leaving on stack",
-		     NONNULL(me->sp->style->name)));
+		     NONNULL(GetHTStyleName(me->sp->style))));
 	    me->objects_mixed_open--;
 	} else if (me->stack_overrun == TRUE &&
 		   element_number != me->sp[0].tag_number) {
@@ -5789,7 +5789,7 @@ static int HTML_end_element(HTStructured * me, int element_number,
 			     "Special OBJECT->FIG handling",
 			     me->objects_figged_open,
 			     "treating as end FIG",
-			     NONNULL(me->sp->style->name)));
+			     NONNULL(GetHTStyleName(me->sp->style))));
 		    me->objects_figged_open--;
 		    element_number = HTML_FIG;
 		}
@@ -5799,7 +5799,7 @@ static int HTML_end_element(HTStructured * me, int element_number,
 		    (tfp,
 		     "HTML:end_element[%d]: Popped style off stack - %s\n",
 		     (int) STACKLEVEL(me),
-		     NONNULL(me->sp->style->name)));
+		     NONNULL(GetHTStyleName(me->sp->style))));
 	} else {
 	    CTRACE2(TRACE_STYLE, (tfp,
 				  "Stack underflow error!  Tried to pop off more styles than exist in stack\n"));
@@ -7396,7 +7396,7 @@ static void HTML_free(HTStructured * me)
     if (me->target) {
 	(*me->targetClass._free) (me->target);
     }
-    if (me->sp && me->sp->style && me->sp->style->name) {
+    if (me->sp && me->sp->style && GetHTStyleName(me->sp->style)) {
 	if (me->sp->style->id == ST_DivCenter ||
 	    me->sp->style->id == ST_HeadingCenter ||
 	    me->sp->style->id == ST_Heading1) {
@@ -7481,7 +7481,7 @@ static void HTML_abort(HTStructured * me, HTError e)
     if (me->target) {
 	(*me->targetClass._abort) (me->target, e);
     }
-    if (me->sp && me->sp->style && me->sp->style->name) {
+    if (me->sp && me->sp->style && GetHTStyleName(me->sp->style)) {
 	if (me->sp->style->id == ST_DivCenter ||
 	    me->sp->style->id == ST_HeadingCenter ||
 	    me->sp->style->id == ST_Heading1) {
diff --git a/src/LYCurses.c b/src/LYCurses.c
index c902769d..8898018f 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.c,v 1.145 2009/11/21 17:05:33 Bela.Lubkin Exp $ */
+/* $LynxId: LYCurses.c,v 1.147 2009/11/27 12:58:21 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAlert.h>
 
@@ -242,7 +242,7 @@ static struct {
 };
 /* *INDENT-ON* */
 
-int string_to_attr(char *name)
+int string_to_attr(const char *name)
 {
     unsigned i;
 
@@ -397,7 +397,7 @@ void setHashStyle(int style,
 		  int color,
 		  int cattr,
 		  int mono,
-		  char *element)
+		  const char *element)
 {
     bucket *ds = &hashStyles[style];
 
diff --git a/src/LYCurses.h b/src/LYCurses.h
index 646bc52b..178b0d4d 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.h,v 1.81 2009/11/21 14:40:20 Bake.Timmons Exp $ */
+/* $LynxId: LYCurses.h,v 1.83 2009/11/27 12:58:31 tom Exp $ */
 #ifndef LYCURSES_H
 #define LYCURSES_H
 
@@ -488,7 +488,7 @@ extern "C" {
 #if defined(USE_COLOR_STYLE)
     extern void curses_css(char *name, int dir);
     extern void curses_style(int style, int dir);
-    extern void setHashStyle(int style, int color, int cattr, int mono, char *element);
+    extern void setHashStyle(int style, int color, int cattr, int mono, const char *element);
     extern void setStyle(int style, int color, int cattr, int mono);
     extern void wcurses_css(WINDOW * win, char *name, int dir);
     extern void curses_w_style(WINDOW * win, int style, int dir);
@@ -629,7 +629,7 @@ extern "C" {
 
 #else				/* Not VMS: */
 
-    extern int string_to_attr(char *name);
+    extern int string_to_attr(const char *name);
 
 /*
  *  For Unix FANCY_FANCY curses we interpose
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 08478a87..d49ac689 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYReadCFG.c,v 1.142 2009/11/21 16:32:23 tom Exp $
+ * $LynxId: LYReadCFG.c,v 1.145 2009/11/27 12:52:37 tom Exp $
  */
 #ifndef NO_RULES
 #include <HTRules.h>
@@ -318,7 +318,7 @@ BOOL default_color_reset = FALSE;
 /*
  * Validator for COLOR fields.
  */
-int check_color(char *color,
+int check_color(const char *color,
 		int the_default)
 {
     int i;
@@ -871,8 +871,8 @@ static int status_buffer_size_fun(char *value)
 
 static int suffix_fun(char *value)
 {
-    char *mime_type, *p;
-    char *encoding = NULL;
+    char *mime_type, *p, *parsed;
+    const char *encoding = NULL;
     char *sq = NULL;
     char *description = NULL;
     double q = 1.0;
@@ -885,9 +885,9 @@ static int suffix_fun(char *value)
 
     *mime_type++ = '\0';
     if (*mime_type) {
-	if ((encoding = strchr(mime_type, ':')) != NULL) {
-	    *encoding++ = '\0';
-	    if ((sq = strchr(encoding, ':')) != NULL) {
+	if ((parsed = strchr(mime_type, ':')) != NULL) {
+	    *parsed++ = '\0';
+	    if ((sq = strchr(parsed, ':')) != NULL) {
 		*sq++ = '\0';
 		if ((description = strchr(sq, ':')) != NULL) {
 		    *description++ = '\0';
@@ -899,11 +899,12 @@ static int suffix_fun(char *value)
 		if (!*sq)
 		    sq = NULL;
 	    }
-	    LYRemoveBlanks(encoding);
-	    LYLowerCase(encoding);
-	    if (!*encoding)
-		encoding = NULL;
+	    LYRemoveBlanks(parsed);
+	    LYLowerCase(parsed);
+	    if (!*parsed)
+		parsed = NULL;
 	}
+	encoding = parsed;
     }
 
     LYRemoveBlanks(mime_type);
@@ -1679,7 +1680,7 @@ void free_lynx_cfg(void)
 #endif
 }
 
-static Config_Type *lookup_config(char *name)
+static Config_Type *lookup_config(const char *name)
 {
     Config_Type *tbl = Config_Table;
     char ch = (char) TOUPPER(*name);
@@ -1765,12 +1766,13 @@ typedef BOOL (optidx_set_t)[NOPTS_];
  * For simple (boolean, string, integer, time) values, set the corresponding
  * configuration variable.
  */
-void LYSetConfigValue(char *name,
+void LYSetConfigValue(const char *name,
 		      char *value)
 {
     Config_Type *tbl = lookup_config(name);
     ParseUnionPtr q = ParseUnionOf(tbl);
-    char *temp = 0;
+    char *temp_name = 0;
+    char *temp_value = 0;
 
     switch (tbl->type) {
     case CONF_BOOL:
@@ -1815,21 +1817,24 @@ void LYSetConfigValue(char *name,
     case CONF_ENV:
     case CONF_ENV2:
 
-	if (tbl->type == CONF_ENV)
-	    LYLowerCase(name);
-	else
-	    LYUpperCase(name);
+	if (StrAllocCopy(temp_name, name)) {
+	    if (tbl->type == CONF_ENV)
+		LYLowerCase(temp_name);
+	    else
+		LYUpperCase(temp_name);
 
-	if (LYGetEnv(name) == 0) {
+	    if (LYGetEnv(temp_name) == 0) {
 #ifdef VMS
-	    Define_VMSLogical(name, value);
+		Define_VMSLogical(temp_name, value);
 #else
-	    if (q->str_value == 0)
-		q->str_value = typecalloc(char *);
+		if (q->str_value == 0)
+		    q->str_value = typecalloc(char *);
 
-	    HTSprintf0(q->str_value, "%s=%s", name, value);
-	    putenv(*(q->str_value));
+		HTSprintf0(q->str_value, "%s=%s", temp_name, value);
+		putenv(*(q->str_value));
 #endif
+	    }
+	    FREE(temp_name);
 	}
 	break;
     case CONF_ADD_ITEM:
@@ -1856,8 +1861,8 @@ void LYSetConfigValue(char *name,
 #endif
 
     case CONF_PRG:
-	if (StrAllocCopy(temp, value))
-	    HTSetProgramPath((ProgramPaths) (q->def_value), temp);
+	if (StrAllocCopy(temp_value, value))
+	    HTSetProgramPath((ProgramPaths) (q->def_value), temp_value);
 	break;
 
     default:
diff --git a/src/LYReadCFG.h b/src/LYReadCFG.h
index cd02a107..8092a8a5 100644
--- a/src/LYReadCFG.h
+++ b/src/LYReadCFG.h
@@ -1,3 +1,6 @@
+/*
+ * $LynxId: LYReadCFG.h,v 1.23 2009/11/27 12:52:34 tom Exp $
+ */
 #ifndef LYREADCFG_H
 #define LYREADCFG_H
 
@@ -41,7 +44,7 @@ extern "C" {
     extern int default_bg;
     extern BOOL default_color_reset;
 
-    extern int check_color(char *color, int the_default);
+    extern int check_color(const char *color, int the_default);
     extern const char *lookup_color(int code);
 #endif
 
@@ -61,7 +64,7 @@ extern "C" {
 						    list_ptr,
 						    char *number);
     extern void reload_read_cfg(void);	/* implemented in LYMain.c */
-    extern void LYSetConfigValue(char *name, char *value);
+    extern void LYSetConfigValue(const char *name, char *value);
 
 #ifdef __cplusplus
 }
diff --git a/src/LYStyle.c b/src/LYStyle.c
index 137f40c4..f0980de5 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYStyle.c,v 1.64 2009/01/01 23:06:42 tom Exp $
+ * $LynxId: LYStyle.c,v 1.66 2009/11/27 14:39:27 tom Exp $
  *
  * character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
@@ -129,40 +129,46 @@ static char *TrimLowercase(char *buffer)
 /*
  * Parse a string containing a combination of video attributes and color.
  */
-static void parse_either(char *attrs,
+static void parse_either(const char *attrs,
 			 int dft_color,
 			 int *monop,
 			 int *colorp)
 {
     int value;
+    char *temp_attrs = NULL;
 
-    while (*attrs != '\0') {
-	char *next = strchr(attrs, '+');
-	char save = (char) ((next != NULL) ? *next : '\0');
+    if (StrAllocCopy(temp_attrs, attrs) != NULL) {
+	char *to_free = temp_attrs;
 
-	if (next == NULL)
-	    next = attrs + strlen(attrs);
+	while (*temp_attrs != '\0') {
+	    char *next = strchr(temp_attrs, '+');
+	    char save = (char) ((next != NULL) ? *next : '\0');
 
-	if (save != 0)		/* attrs might be a constant string */
-	    *next = '\0';
-	if ((value = string_to_attr(attrs)) != 0)
-	    *monop |= value;
-	else if (colorp != 0
-		 && (value = check_color(attrs, dft_color)) != ERR_COLOR)
-	    *colorp = value;
+	    if (next == NULL)
+		next = temp_attrs + strlen(temp_attrs);
 
-	attrs = next;
-	if (save != '\0')
-	    *attrs++ = save;
+	    if (save != 0)
+		*next = '\0';
+	    if ((value = string_to_attr(temp_attrs)) != 0)
+		*monop |= value;
+	    else if (colorp != 0
+		     && (value = check_color(temp_attrs, dft_color)) != ERR_COLOR)
+		*colorp = value;
+
+	    temp_attrs = next;
+	    if (save != '\0')
+		*temp_attrs++ = save;
+	}
+	FREE(to_free);
     }
 }
 
 /* icky parsing of the style options */
-static void parse_attributes(char *mono,
-			     char *fg,
-			     char *bg,
+static void parse_attributes(const char *mono,
+			     const char *fg,
+			     const char *bg,
 			     int style,
-			     char *element)
+			     const char *element)
 {
     int mA = A_NORMAL;
     int fA = default_fg;
@@ -259,7 +265,7 @@ static void parse_style(char *param)
 {
     /* *INDENT-OFF* */
     static struct {
-	char *name;
+	const char *name;
 	int style;
 	int *set_hash;
     } table[] = {
@@ -298,7 +304,8 @@ static void parse_style(char *param)
 
     char *buffer = 0;
     char *tmp = 0;
-    char *element, *mono, *fg, *bg;
+    char *element, *mono;
+    const char *fg, *bg;
 
     if (param == 0)
 	return;
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index dc76e41b..1d10cdee 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYrcFile.c,v 1.81 2009/06/07 17:11:00 tom Exp $ */
+/* $LynxId: LYrcFile.c,v 1.82 2009/11/27 11:15:54 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <LYUtils.h>
@@ -178,7 +178,7 @@ const char *LYputEnum(Config_Enum * table, int value)
     return "?";
 }
 
-BOOL LYgetEnum(Config_Enum * table, char *name,
+BOOL LYgetEnum(Config_Enum * table, const char *name,
 	       int *result)
 {
     Config_Enum *found = 0;
diff --git a/src/LYrcFile.h b/src/LYrcFile.h
index 22f56861..f1ee99b0 100644
--- a/src/LYrcFile.h
+++ b/src/LYrcFile.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYrcFile.h,v 1.33 2009/06/07 16:56:00 tom Exp $
+ * $LynxId: LYrcFile.h,v 1.34 2009/11/27 11:16:04 tom Exp $
  */
 #ifndef LYRCFILE_H
 #define LYRCFILE_H
@@ -271,7 +271,7 @@ extern Config_Enum tbl_preferred_media[];
 extern Config_Enum tbl_transfer_rate[];
 extern Config_Enum tbl_user_mode[];
 
-extern BOOL LYgetEnum(Config_Enum * table, char *name, int *result);
+extern BOOL LYgetEnum(Config_Enum * table, const char *name, int *result);
 extern BOOL will_save_rc(const char *name);
 extern const char *LYputEnum(Config_Enum * table, int value);
 extern int enable_lynxrc(char *value);