changeset: 2774:9de8efec7dc1
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Sat Jul 31 16:20:51 2010 -0400
files: cmd/menu/history.c cmd/menu/menu.c cmd/wmii/message.c
description:
[menu] Fix numeric keypad input. Closes issue #213.
diff -r a10d01316287 -r 9de8efec7dc1 cmd/menu/history.c
--- a/cmd/menu/history.c Tue Jul 27 14:45:42 2010 -0400
+++ b/cmd/menu/history.c Sat Jul 31 16:20:51 2010 -0400
@@ -82,7 +82,10 @@
Binit(&b, fd, OWRITE);
hist.next = nil;
for(h=first; h; h=h->next)
- Bprint(&b, "%s\n", h->string);
+ if(Bprint(&b, "%s\n", h->string) < 0) {
+ unlink(tmp);
+ exit(1);
+ }
Bterm(&b);
rename(tmp, path);
exit(0);
diff -r a10d01316287 -r 9de8efec7dc1 cmd/menu/menu.c
--- a/cmd/menu/menu.c Tue Jul 27 14:45:42 2010 -0400
+++ b/cmd/menu/menu.c Sat Jul 31 16:20:51 2010 -0400
@@ -265,8 +265,9 @@
int num;
KeySym ksym;
- buf[0] = 0;
+ buf[0] = '\0';
num = XLookupString(e, buf, sizeof buf, &ksym, 0);
+ buf[num] = '\0';
key = XKeysymToString(ksym);
if(IsKeypadKey(ksym))
if(ksym == XK_KP_Enter)
diff -r a10d01316287 -r 9de8efec7dc1 cmd/wmii/message.c
--- a/cmd/wmii/message.c Tue Jul 27 14:45:42 2010 -0400
+++ b/cmd/wmii/message.c Sat Jul 31 16:20:51 2010 -0400
@@ -907,13 +907,12 @@
void
msg_parsecolors(IxpMsg *m, CTuple *col) {
CTuple tpl;
- static char Ebad[] = "bad color string";
char n;
n = loadcolor(&tpl, m->pos, m->end);
m->pos += n;
if(n == 0 || msg_getword(m, nil))
- error(Ebad);
+ error("bad color string");
*col = tpl;
}
Received on Sat Jul 31 2010 - 22:21:05 CEST
This archive was generated by hypermail 2.2.0 : Sat Jul 31 2010 - 22:24:05 CEST