about summary refs log tree commit diff stats
path: root/src/LYOptions.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-03-20 00:22:41 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-03-20 00:22:41 +0000
commitecb7dae178b85d6a0459660495ee4554b2eaac92 (patch)
tree3f937ac779c42f70a1ef985340109e5c52a41d99 /src/LYOptions.c
parent7cec919da585246a86443c57e1f04fc79cce5954 (diff)
downloadlynx-snapshots-ecb7dae178b85d6a0459660495ee4554b2eaac92.tar.gz
snapshot of project "lynx", label v2-8-9dev_16w
Diffstat (limited to 'src/LYOptions.c')
-rw-r--r--src/LYOptions.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/LYOptions.c b/src/LYOptions.c
index b0084396..6b4b0e0a 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYOptions.c,v 1.177 2018/03/18 16:38:00 tom Exp $ */
+/* $LynxId: LYOptions.c,v 1.178 2018/03/19 23:06:50 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <HTTP.h>		/* 'reloading' flag */
@@ -2119,6 +2119,8 @@ typedef struct {
 
 #define END_OPTIONS {0, 0, 0}
 
+#define HasOptValues(table) (((table) != NULL) && ((table)->LongName != NULL))
+
 typedef struct {
     char *tag;
     char *value;
@@ -3574,7 +3576,7 @@ static void PutLabel(FILE *fp, const char *name,
     int need = LYstrExtent(name, have, want);
     char *buffer = NULL;
 
-    fprintf(fp, "%s%s", MARGIN_STR, LYEntifyTitle(&buffer, name));
+    fprintf(fp, "%s%s", MARGIN_STR, LYEntifyTitle(&buffer, NonNull(name)));
 
     if (will_save_rc(value) && !no_option_save) {
 	while (need++ < want)
@@ -3985,10 +3987,12 @@ static int gen_options(char **newfile)
 
 #ifdef USE_COLOR_STYLE
     /* Color style: ON/OFF */
-    PutLabel(fp0, gettext("Color style"), color_style_string);
-    BeginSelect(fp0, color_style_string);
-    PutOptValues(fp0, get_color_style_value(), color_style_values);
-    EndSelect(fp0);
+    if (HasOptValues(color_style_values)) {
+	PutLabel(fp0, gettext("Color style"), color_style_string);
+	BeginSelect(fp0, color_style_string);
+	PutOptValues(fp0, get_color_style_value(), color_style_values);
+	EndSelect(fp0);
+    }
 #endif
 
 #ifdef USE_DEFAULT_COLORS