summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-03-08 18:13:16 +0000
committerEd Maste <emaste@FreeBSD.org>2020-03-08 18:13:16 +0000
commitdc1b2162c126dbbd7783572e2823f74fad175702 (patch)
tree2e7ef9dc79fce0c54ad39c80a7574b8393cf8e2e
parentd11cc0f2b6b00b19fb229587455badb831329a84 (diff)
downloadsrc-test2-dc1b2162c126dbbd7783572e2823f74fad175702.tar.gz
src-test2-dc1b2162c126dbbd7783572e2823f74fad175702.zip
Notes
-rw-r--r--usr.sbin/kbdmap/kbdmap.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/kbdmap/kbdmap.c b/usr.sbin/kbdmap/kbdmap.c
index 555f4b3c3b81..4f99ba03c2c8 100644
--- a/usr.sbin/kbdmap/kbdmap.c
+++ b/usr.sbin/kbdmap/kbdmap.c
@@ -57,6 +57,7 @@ static const char *sysconfig = DEFAULT_SYSCONFIG;
static const char *font_current;
static const char *dir;
static const char *menu = "";
+static const char *title = "Keyboard Menu";
static int x11;
static int using_vt;
@@ -360,8 +361,8 @@ show_dialog(struct keymap **km_sorted, int num_keymaps)
tmp_name);
exit(1);
}
- asprintf(&dialog, "/usr/bin/dialog --clear --title \"Keyboard Menu\" "
- "--menu \"%s\" 0 0 0", menu);
+ asprintf(&dialog, "/usr/bin/dialog --clear --title \"%s\" "
+ "--menu \"%s\" 0 0 0", title, menu);
/* start right font, assume that current font is equal
* to default font in /etc/rc.conf
@@ -627,8 +628,9 @@ menu_read(void)
matches = sscanf(p, "%64[^:]:%64[^:]:%256[^:\n]",
keym, lng, desc);
if (matches == 3) {
- if (strcmp(keym, "FONT")
- && strcmp(keym, "MENU")) {
+ if (strcmp(keym, "FONT") != 0 &&
+ strcmp(keym, "MENU") != 0 &&
+ strcmp(keym, "TITLE") != 0) {
/* Check file exists & is readable */
if (check_file(keym) == -1)
continue;
@@ -705,6 +707,10 @@ menu_read(void)
exit(0);
}
+ km = get_keymap("TITLE");
+ if (km)
+ /* Take note of dialog title */
+ title = strdup(km->desc);
km = get_keymap("MENU");
if (km)
/* Take note of menu title */
@@ -715,8 +721,9 @@ menu_read(void)
font = strdup(km->desc);
/* Remove unwanted items from list */
- remove_keymap("MENU");
remove_keymap("FONT");
+ remove_keymap("MENU");
+ remove_keymap("TITLE");
/* Look for keymaps not in database */
dirp = opendir(dir);