about summary refs log tree commit diff stats
path: root/src
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
parent7cec919da585246a86443c57e1f04fc79cce5954 (diff)
downloadlynx-snapshots-ecb7dae178b85d6a0459660495ee4554b2eaac92.tar.gz
snapshot of project "lynx", label v2-8-9dev_16w
Diffstat (limited to 'src')
-rw-r--r--src/LYCurses.c13
-rw-r--r--src/LYOptions.c16
2 files changed, 19 insertions, 10 deletions
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 6656f10b..e768aaf5 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.c,v 1.193 2018/03/18 19:19:12 tom Exp $ */
+/* $LynxId: LYCurses.c,v 1.194 2018/03/19 22:38:49 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAlert.h>
 
@@ -2251,11 +2251,16 @@ int LYstrExtent0(const char *string,
 		 int maxCells GCC_UNUSED,
 		 int retCellNum GCC_UNUSED)
 {
-    int used = (len < 0 ? (int) strlen(string) : len);
-    int result = used;
+    int used, result;
 
+    if (isEmpty(string)) {
+	used = ((len > 0) ? len : 0);
+    } else {
+	used = ((len < 0) ? (int) strlen(string) : len);
+    }
+    result = used;
 #ifdef WIDEC_CURSES
-    if (used > 0 && lynx_called_initscr) {
+    if (non_empty(string) && used > 0 && lynx_called_initscr) {
 	static WINDOW *fake_win;
 	static int fake_max;
 
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