matcher: Use less relocations

parent bef7a550
This diff is collapsed.
......@@ -35,13 +35,7 @@ G_BEGIN_DECLS
#define _VTE_CAP_SS2 _VTE_CAP_ESC "N" /* Single-shift to G2 */
#define _VTE_CAP_SS3 _VTE_CAP_ESC "O" /* Single-shift to G3 */
struct _vte_capability_string {
const char *code;
const char *value;
};
/* The xterm-specific terminal control strings, terminated by NULLs. */
extern struct _vte_capability_string _vte_xterm_capability_strings[];
extern const char _vte_xterm_capability_strings[];
G_END_DECLS
......
......@@ -54,15 +54,15 @@ static void
_vte_matcher_init(struct _vte_matcher *matcher)
{
const char *code, *value;
int i;
_vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_init()\n");
for (i = 0; _vte_xterm_capability_strings[i].value != NULL; i++) {
code = _vte_xterm_capability_strings[i].code;
value = _vte_xterm_capability_strings[i].value;
_vte_matcher_add(matcher, code, strlen (code), value);
}
code = _vte_xterm_capability_strings;
do {
value = strchr(code, '\0') + 1;
_vte_matcher_add(matcher, code, strlen(code), value);
code = strchr(value, '\0') + 1;
} while (*code);
_VTE_DEBUG_IF(VTE_DEBUG_MATCHER) {
g_printerr("Matcher contents:\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment