=== modified file 'driver-ti.c' --- driver-ti.c 2008-12-03 20:19:15 +0000 +++ driver-ti.c 2008-12-02 01:05:47 +0000 @@ -1,6 +1,3 @@ -// we want strdup() -#define _XOPEN_SOURCE 500 - #include "termkey.h" #include "termkey-internal.h" @@ -42,9 +39,6 @@ termkey_t *tk; struct trie_node *root; - - char *start_string; - char *stop_string; } termkey_ti; static int funcname2keysym(const char *funcname, termkey_type *typep, termkey_keysym *symp, int *modmask, int *modsetp); @@ -195,20 +189,6 @@ ti->root = compress_trie(ti->root); - /* Take copies of these terminfo strings, in case we build multiple termkey - * instances for multiple different termtypes, and it's different by the - * time we want to use it - */ - if(keypad_xmit) - ti->start_string = strdup(keypad_xmit); - else - ti->start_string = NULL; - - if(keypad_local) - ti->stop_string = strdup(keypad_local); - else - ti->stop_string = NULL; - return ti; abort_free_trie: @@ -222,24 +202,20 @@ static void start_driver(termkey_t *tk, void *info) { - termkey_ti *ti = info; - /* The terminfo database will contain keys in application cursor key mode. * We may need to enable that mode */ - if(ti->start_string) { + if(keypad_xmit) { // Can't call putp or tputs because they suck and don't give us fd control - write(tk->fd, ti->start_string, strlen(ti->start_string)); + write(tk->fd, keypad_xmit, strlen(keypad_xmit)); } } static void stop_driver(termkey_t *tk, void *info) { - termkey_ti *ti = info; - - if(ti->stop_string) { + if(keypad_local) { // Can't call putp or tputs because they suck and don't give us fd control - write(tk->fd, ti->stop_string, strlen(ti->stop_string)); + write(tk->fd, keypad_local, strlen(keypad_local)); } } @@ -249,12 +225,6 @@ free_trie(ti->root); - if(ti->start_string) - free(ti->start_string); - - if(ti->stop_string) - free(ti->stop_string); - free(ti); }