* [kbd] kbd: loadkeys -d doesn't work
@ 2011-10-10 7:48 ` Jaroslav Skarvada
2011-10-21 10:42 ` Alexey Gladkov
0 siblings, 1 reply; 6+ messages in thread
From: Jaroslav Skarvada @ 2011-10-10 7:48 UTC (permalink / raw)
To: kbd
[-- Attachment #1: Type: text/plain, Size: 161 bytes --]
The loadkeys -d doesn't work any more (kbd-1.15.3).
According to man and previous behaviour, I think it
should work. Possible fix is attached
regards
Jaroslav
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: kbd-1.15.3-fix-load-defkeymap.patch --]
[-- Type: text/x-patch; name=kbd-1.15.3-fix-load-defkeymap.patch, Size: 669 bytes --]
diff -up kbd-1.15.3/src/loadkeys.c.orig kbd-1.15.3/src/loadkeys.c
--- kbd-1.15.3/src/loadkeys.c.orig 2011-05-07 22:33:42.000000000 +0200
+++ kbd-1.15.3/src/loadkeys.c 2011-10-09 14:34:52.533549215 +0200
@@ -2958,7 +2958,7 @@ int main(int argc, char *argv[])
close(fd);
}
- for (i = optind; argv[i]; i++) {
+ for (i = optind; argv[i] || optd; i++) {
FILE *f;
char *ev;
@@ -2974,6 +2974,7 @@ int main(int argc, char *argv[])
if (optd) {
/* first read default map - search starts in . */
optd = 0;
+ i--;
if ((f = findfile(DEFMAP, dirpath, suffixes)) == NULL) {
fprintf(stderr, _("Cannot find %s\n"), DEFMAP);
exit(EXIT_FAILURE);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbd] kbd: loadkeys -d doesn't work
2011-10-10 7:48 ` [kbd] kbd: loadkeys -d doesn't work Jaroslav Skarvada
@ 2011-10-21 10:42 ` Alexey Gladkov
2011-10-21 14:56 ` Jaroslav Skarvada
0 siblings, 1 reply; 6+ messages in thread
From: Alexey Gladkov @ 2011-10-21 10:42 UTC (permalink / raw)
To: kbd
10.10.2011 11:48, Jaroslav Skarvada wrote:
> The loadkeys -d doesn't work any more (kbd-1.15.3).
> According to man and previous behaviour, I think it
> should work. Possible fix is attached
I fixed this bug in my git. Sorry for long delay.
Can you confirm fix ?
--
Rgrds, legion
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbd] kbd: loadkeys -d doesn't work
2011-10-21 10:42 ` Alexey Gladkov
@ 2011-10-21 14:56 ` Jaroslav Skarvada
2011-10-21 22:54 ` Alexey Gladkov
0 siblings, 1 reply; 6+ messages in thread
From: Jaroslav Skarvada @ 2011-10-21 14:56 UTC (permalink / raw)
To: Linux console tools development discussion
----- Original Message -----
> 10.10.2011 11:48, Jaroslav Skarvada wrote:
> > The loadkeys -d doesn't work any more (kbd-1.15.3).
> > According to man and previous behaviour, I think it
> > should work. Possible fix is attached
>
> I fixed this bug in my git. Sorry for long delay.
> Can you confirm fix ?
>
I think it shouldn't read stdin in case of optd
Jaroslav
diff -up kbd-1.15.3/src/loadkeys.c.orig kbd-1.15.3/src/loadkeys.c
--- kbd-1.15.3/src/loadkeys.c.orig 2011-10-21 16:42:09.304296233 +0200
+++ kbd-1.15.3/src/loadkeys.c 2011-10-21 16:41:01.595072657 +0200
@@ -3021,7 +3021,7 @@ int main(int argc, char *argv[])
parse_keymap(f);
}
- if (optind == argc) {
+ if (!optd && optind == argc) {
strcpy(pathname, "<stdin>");
parse_keymap(stdin);
}
diff -up kbd-1.15.3/src/loadkeys.y.orig kbd-1.15.3/src/loadkeys.y
--- kbd-1.15.3/src/loadkeys.y.orig 2011-10-21 12:16:39.000000000 +0200
+++ kbd-1.15.3/src/loadkeys.y 2011-10-21 16:42:41.192924078 +0200
@@ -1210,7 +1210,7 @@ int main(int argc, char *argv[])
parse_keymap(f);
}
- if (optind == argc) {
+ if (!optd && optind == argc) {
strcpy(pathname, "<stdin>");
parse_keymap(stdin);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbd] kbd: loadkeys -d doesn't work
2011-10-21 14:56 ` Jaroslav Skarvada
@ 2011-10-21 22:54 ` Alexey Gladkov
2011-10-22 11:35 ` Jaroslav Skarvada
0 siblings, 1 reply; 6+ messages in thread
From: Alexey Gladkov @ 2011-10-21 22:54 UTC (permalink / raw)
To: kbd
21.10.2011 18:56, Jaroslav Skarvada wrote:
> I think it shouldn't read stdin in case of optd
But in your previous email to you, do exactly the same.
What has changed?
Why behavior when the file must be different from the standard input
handle ? I don't see any difference.
--
Rgrds, legion
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbd] kbd: loadkeys -d doesn't work
2011-10-21 22:54 ` Alexey Gladkov
@ 2011-10-22 11:35 ` Jaroslav Skarvada
2011-10-22 19:52 ` Alexey Gladkov
0 siblings, 1 reply; 6+ messages in thread
From: Jaroslav Skarvada @ 2011-10-22 11:35 UTC (permalink / raw)
To: Linux console tools development discussion
> 21.10.2011 18:56, Jaroslav Skarvada wrote:
> > I think it shouldn't read stdin in case of optd
>
> But in your previous email to you, do exactly the same.
> What has changed?
>
> Why behavior when the file must be different from the standard input
> handle ? I don't see any difference.
>
I tried your git head, loadkeys -d loads defkeymap as expected
but it then blocks on reading stdin. According to doc I think it
should return after the defkeymap is loaded. Sorry if I missed
anything
regards
Jaroslav
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kbd] kbd: loadkeys -d doesn't work
2011-10-22 11:35 ` Jaroslav Skarvada
@ 2011-10-22 19:52 ` Alexey Gladkov
0 siblings, 0 replies; 6+ messages in thread
From: Alexey Gladkov @ 2011-10-22 19:52 UTC (permalink / raw)
To: kbd
22.10.2011 15:35, Jaroslav Skarvada wrote:
> I tried your git head, loadkeys -d loads defkeymap as expected
> but it then blocks on reading stdin. According to doc I think it
> should return after the defkeymap is loaded. Sorry if I missed
> anything
You are right. "loadkeys -d" should load defkeymap only.
--
Rgrds, legion
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-22 19:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-10 7:48 ` [kbd] kbd: loadkeys -d doesn't work Jaroslav Skarvada
2011-10-21 10:42 ` Alexey Gladkov
2011-10-21 14:56 ` Jaroslav Skarvada
2011-10-21 22:54 ` Alexey Gladkov
2011-10-22 11:35 ` Jaroslav Skarvada
2011-10-22 19:52 ` Alexey Gladkov
Linux console tools development discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/kbd/0 kbd/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 kbd kbd/ http://lore.altlinux.org/kbd \
kbd@lists.altlinux.org kbd@lists.altlinux.ru kbd@lists.altlinux.com
public-inbox-index kbd
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.kbd
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git