Package: kbd
Version: 1.15.3-9
Severity: normal

"loadkeys -d" is supposed to load the default keymap. Instead it loads stdin.

"loadkeys -d somefile" should load the default keymap, then somefile.

This patch fixes all the usage cases, I think, but the loop logic is getting
ugly so you might want to rework it.

Index: kbd-1.15.3/src/loadkeys.y
===================================================================
--- kbd-1.15.3.orig/src/loadkeys.y      2013-05-22 05:32:30.378879662 -0500
+++ kbd-1.15.3/src/loadkeys.y   2013-05-22 05:36:37.890876881 -0500
@@ -1163,7 +1163,8 @@
                close(fd);
        }
 
-       for (i = optind; argv[i]; i++) {
+       int did_optd = 0;
+       for (i = optind; optd || argv[i]; i++) {
                FILE *f;
                char *ev;
 
@@ -1177,8 +1178,10 @@
                }
 
                if (optd) {
+                       --i;
                        /* first read default map - search starts in . */
                        optd = 0;
+                       did_optd = 1;
                        if ((f = findfile(DEFMAP, dirpath, suffixes)) == NULL) {
                                fprintf(stderr, _("Cannot find %s\n"), DEFMAP);
                                exit(EXIT_FAILURE);
@@ -1199,7 +1202,7 @@
                parse_keymap(f);
        }
 
-       if (optind == argc) {
+       if (optind == argc && !did_optd) {
                strcpy(pathname, "<stdin>");
                parse_keymap(stdin);
        }

-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.8.2+ (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages kbd depends on:
ii  libc6     2.13-38
ii  lsb-base  4.1+Debian8

Versions of packages kbd recommends:
ii  console-data  2:1.12-2

kbd suggests no packages.

-- Configuration Files:
/etc/kbd/config changed [not included]
/etc/kbd/remap [Errno 2] No such file or directory: u'/etc/kbd/remap'

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to