summaryrefslogtreecommitdiffstats
path: root/contrib/dialog/rc.c
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2012-12-30 04:22:34 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2012-12-30 04:22:34 +0000
commit52bf5abd924bc78494905f16ffbd4bd67062240c (patch)
tree6d48accafd38ffd900622df8c9eab499d302c36f /contrib/dialog/rc.c
parent7e3a527820c0248a0703bbf8809aabef78a41db6 (diff)
downloadFreeBSD-src-52bf5abd924bc78494905f16ffbd4bd67062240c.zip
FreeBSD-src-52bf5abd924bc78494905f16ffbd4bd67062240c.tar.gz
Revert r241818 that updated dialog to 20120706. This turns out to horribly
break mixed form dialogs in conjunction with the FreeBSD termcap, making the bsdinstall partition editor Add dialog, among other things, completely nonfunctional. This restores dialog 20110707.
Diffstat (limited to 'contrib/dialog/rc.c')
-rw-r--r--contrib/dialog/rc.c45
1 files changed, 9 insertions, 36 deletions
diff --git a/contrib/dialog/rc.c b/contrib/dialog/rc.c
index cc6af29..2e2c7e6 100644
--- a/contrib/dialog/rc.c
+++ b/contrib/dialog/rc.c
@@ -1,5 +1,5 @@
/*
- * $Id: rc.c,v 1.49 2011/10/15 00:56:44 tom Exp $
+ * $Id: rc.c,v 1.47 2011/06/20 22:30:04 tom Exp $
*
* rc.c -- routines for processing the configuration file
*
@@ -203,10 +203,9 @@ attr_to_str(char *str, int fg, int bg, int hl)
/*
* Extract the foreground, background and highlight values from an attribute
- * represented as a string in one of two forms:
+ * represented as a string in this form:
*
* "(foreground,background,highlight)"
- " "xxxx_color"
*/
static int
str_to_attr(char *str, int *fg, int *bg, int *hl)
@@ -215,15 +214,8 @@ str_to_attr(char *str, int *fg, int *bg, int *hl)
unsigned j;
char tempstr[MAX_LEN + 1], *part;
- if (str[0] != '(' || lastch(str) != ')') {
- if ((i = find_color(str)) >= 0) {
- *fg = dlg_color_table[i].fg;
- *bg = dlg_color_table[i].bg;
- *hl = dlg_color_table[i].hilite;
- return 0;
- }
+ if (str[0] != '(' || lastch(str) != ')')
return -1; /* invalid representation */
- }
/* remove the parenthesis */
strcpy(tempstr, str + 1);
@@ -432,29 +424,13 @@ dlg_create_rc(const char *filename)
#ifdef HAVE_COLOR
for (i = 0; i < (unsigned) dlg_color_count(); ++i) {
char buffer[MAX_LEN + 1];
- unsigned j;
- bool repeat = FALSE;
fprintf(rc_file, "\n# %s\n", dlg_color_table[i].comment);
- for (j = 0; j != i; ++j) {
- if (dlg_color_table[i].fg == dlg_color_table[j].fg
- && dlg_color_table[i].bg == dlg_color_table[j].bg
- && dlg_color_table[i].hilite == dlg_color_table[j].hilite) {
- fprintf(rc_file, "%s = %s\n",
- dlg_color_table[i].name,
- dlg_color_table[j].name);
- repeat = TRUE;
- break;
- }
- }
-
- if (!repeat) {
- fprintf(rc_file, "%s = %s\n", dlg_color_table[i].name,
- attr_to_str(buffer,
- dlg_color_table[i].fg,
- dlg_color_table[i].bg,
- dlg_color_table[i].hilite));
- }
+ fprintf(rc_file, "%s = %s\n", dlg_color_table[i].name,
+ attr_to_str(buffer,
+ dlg_color_table[i].fg,
+ dlg_color_table[i].bg,
+ dlg_color_table[i].hilite));
}
#endif /* HAVE_COLOR */
dlg_dump_keys(rc_file);
@@ -531,10 +507,7 @@ dlg_parse_rc(void)
lastch(str) = '\0';
if (begins_with(str, "bindkey", &params)) {
- if (!dlg_parse_bindkey(params)) {
- fprintf(stderr, "\nParse error: line %d of configuration\n", l);
- result = -1;
- }
+ dlg_parse_bindkey(params);
continue;
}
parse = parse_line(str, &var, &value); /* parse current line */
OpenPOWER on IntegriCloud