finch/libgnt/gntkeys.c

branch
soc.2007.finchfeat
changeset 19313
3e25f043dbb8
parent 18615
e93a1eb0fad7
--- a/finch/libgnt/gntkeys.c	Sat Aug 11 02:38:56 2007 +0000
+++ b/finch/libgnt/gntkeys.c	Sat Aug 11 09:32:06 2007 +0000
@@ -72,6 +72,7 @@
 	INSERT_KEY("pagedown", GNT_KEY_PGDOWN);
 	INSERT_KEY("insert",   GNT_KEY_INS);
 	INSERT_KEY("delete",   GNT_KEY_DEL);
+	INSERT_KEY("back_tab", GNT_KEY_BACK_TAB);
 
 	INSERT_KEY("left",   GNT_KEY_LEFT);
 	INSERT_KEY("right",  GNT_KEY_RIGHT);
@@ -205,8 +206,8 @@
 		node->flags |= IS_END;
 		return;
 	}
-	while (*path && node->next[*path]) {
-		node = node->next[*path];
+	while (*path && node->next[(unsigned char)*path]) {
+		node = node->next[(unsigned char)*path];
 		node->ref++;
 		path++;
 	}
@@ -214,7 +215,7 @@
 		return;
 	n = g_new0(struct _node, 1);
 	n->ref = 1;
-	node->next[*path++] = n;
+	node->next[(unsigned char)*path++] = n;
 	add_path(n, path);
 }
 
@@ -229,13 +230,13 @@
 
 	if (!*path)
 		return;
-	next = node->next[*path];
+	next = node->next[(unsigned char)*path];
 	if (!next)
 		return;
 	del_path(next, path + 1);
 	next->ref--;
 	if (next->ref == 0) {
-		node->next[*path] = NULL;
+		node->next[(unsigned char)*path] = NULL;
 		g_free(next);
 	}
 }
@@ -251,12 +252,12 @@
 	struct _node *n = &root;
 
 	root.flags &= ~IS_END;
-	while (*path && n->next[*path] && !(n->flags & IS_END)) {
+	while (*path && n->next[(unsigned char)*path] && !(n->flags & IS_END)) {
 		if (!g_ascii_isspace(*path) &&
 				!g_ascii_iscntrl(*path) &&
 				!g_ascii_isgraph(*path))
 			return 0;
-		n = n->next[*path++];
+		n = n->next[(unsigned char)*path++];
 		depth++;
 	}
 

mercurial