comparison finch/libgnt/gntkeys.c @ 16044:ca463cecd432

Only ascii keys can be bound, fixes a crash when inputting non-ascii chars
author Richard Nelson <wabz@pidgin.im>
date Tue, 10 Apr 2007 09:32:52 +0000
parents 2c81ebc7bf0b
children d8b9bea550bc 05d7fe2320a9
comparison
equal deleted inserted replaced
16041:ef727f4b9aac 16044:ca463cecd432
228 int depth = 0; 228 int depth = 0;
229 struct _node *n = &root; 229 struct _node *n = &root;
230 230
231 root.flags &= ~IS_END; 231 root.flags &= ~IS_END;
232 while (*path && n->next[*path] && !(n->flags & IS_END)) { 232 while (*path && n->next[*path] && !(n->flags & IS_END)) {
233 if (g_utf8_find_next_char(path, NULL) - path > 1) 233 if (!g_ascii_isspace(*path) &&
234 !g_ascii_iscntrl(*path) &&
235 !g_ascii_isgraph(*path))
234 return 0; 236 return 0;
235 n = n->next[*path++]; 237 n = n->next[*path++];
236 depth++; 238 depth++;
237 } 239 }
238 240