about summary refs log tree commit diff stats
path: root/src/LYOptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LYOptions.c')
-rw-r--r--src/LYOptions.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 6e73d227..24cac109 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYOptions.c,v 1.130 2009/05/22 00:47:15 tom Exp $ */
+/* $LynxId: LYOptions.c,v 1.133 2009/06/07 18:24:50 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <HTTP.h>		/* 'reloading' flag */
@@ -2277,6 +2277,16 @@ static OptValues DTD_type_values[] =
     {0, 0, 0}
 };
 
+static const char *bad_html_string = RC_BAD_HTML;
+static OptValues bad_html_values[] =
+{
+    {BAD_HTML_IGNORE, N_("Ignore"), "ignore"},
+    {BAD_HTML_TRACE, N_("Add to trace-file"), "trace"},
+    {BAD_HTML_MESSAGE, N_("Add to LYNXMESSAGES"), "message"},
+    {BAD_HTML_WARN, N_("Warn, point to trace-file"), "warn"},
+    {0, 0, 0}
+};
+
 static const char *select_popups_string = RC_SELECT_POPUPS;
 static const char *images_string = "images";
 static const char *images_ignore_all_string = N_("ignore");
@@ -2433,8 +2443,8 @@ static const char *user_agent_string = RC_USERAGENT;
 
 #define PutCheckBox(fp, Name, Value, disable) \
 	fprintf(fp,\
-	"<input type=\"checkbox\" name=\"%s\" value=\"%s\" %s>\n",\
-		Name, Value ? "true" : "false", disable_all?disabled_string:disable)
+	"<input type=\"checkbox\" name=\"%s\" %s %s>\n",\
+		Name, Value ? "checked" : "", disable_all?disabled_string:disable)
 
 #define PutTextInput(fp, Name, Value, Size, disable) \
 	fprintf(fp,\
@@ -2698,6 +2708,11 @@ int postoptions(DocInfo *newdoc)
 	return (NOT_FOUND);
     }
 
+    /*
+     * Checkbox will be missing from data if unchecked.
+     */
+    LYSendUserAgent = FALSE;
+
     for (i = 0; data[i].tag != NULL; i++) {
 	/*
 	 * This isn't really for security, but rather for avoiding that the
@@ -2846,6 +2861,12 @@ int postoptions(DocInfo *newdoc)
 	    }
 	}
 
+	/* Bad HTML warnings: SELECT */
+	if (!strcmp(data[i].tag, bad_html_string)
+	    && GetOptValues(bad_html_values, data[i].value, &code)) {
+	    cfg_bad_html = code;
+	}
+
 	/* Select Popups: ON/OFF */
 	if (!strcmp(data[i].tag, select_popups_string)
 	    && GetOptValues(bool_values, data[i].value, &code)) {
@@ -3091,6 +3112,11 @@ int postoptions(DocInfo *newdoc)
 	    }
 	}
 
+	/* Send User Agent: INPUT */
+	if (!strcmp(data[i].tag, send_user_agent_string)) {
+	    LYSendUserAgent = !strcasecomp(data[i].value, "ON");
+	}
+
 	/* User Agent: INPUT */
 	if (!strcmp(data[i].tag, user_agent_string) && (!no_useragent)) {
 	    if (strcmp(LYUserAgent, data[i].value)) {
@@ -3753,6 +3779,12 @@ static int gen_options(char **newfile)
     PutOptValues(fp0, Old_DTD, DTD_type_values);
     EndSelect(fp0);
 
+    /* Bad HTML messages: SELECT */
+    PutLabel(fp0, gettext("Bad HTML messages"), bad_html_string);
+    BeginSelect(fp0, bad_html_string);
+    PutOptValues(fp0, cfg_bad_html, bad_html_values);
+    EndSelect(fp0);
+
     /* Show Images: SELECT */
     PutLabel(fp0, gettext("Show images"), will_save_images());
     BeginSelect(fp0, images_string);