aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dumbsh.c
diff options
context:
space:
mode:
Diffstat (limited to 'dumbsh.c')
-rw-r--r--dumbsh.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dumbsh.c b/dumbsh.c
index d2a265b..cd4b554 100644
--- a/dumbsh.c
+++ b/dumbsh.c
@@ -168,8 +168,7 @@ static struct keyCommand simpleEmacsKeys[] =
168 {"Home", startOfLine}, 168 {"Home", startOfLine},
169 {"^A", startOfLine}, 169 {"^A", startOfLine},
170 {"Up", prevHistory}, 170 {"Up", prevHistory},
171 {"^P", prevHistory}, 171 {"^P", prevHistory}
172 {NULL, NULL}
173}; 172};
174 173
175static int handleKeySequence(long extra, char *sequence) 174static int handleKeySequence(long extra, char *sequence)
@@ -177,7 +176,7 @@ static int handleKeySequence(long extra, char *sequence)
177 int j; 176 int j;
178 177
179 // Search for a key sequence bound to a command. 178 // Search for a key sequence bound to a command.
180 for (j = 0; simpleEmacsKeys[j].key; j++) 179 for (j = 0; j < (sizeof(simpleEmacsKeys) / sizeof(*simpleEmacsKeys)); j++)
181 { 180 {
182 if (strcmp(simpleEmacsKeys[j].key, sequence) == 0) 181 if (strcmp(simpleEmacsKeys[j].key, sequence) == 0)
183 { 182 {