From: ayin Date: Sun, 9 Sep 2007 10:14:40 +0000 (+0000) Subject: Remove useless indirection for {backspace,delete}key resources. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=97ba909a82259c5f8d82b20d85aeadf19a894812;p=dana%2Furxvt.git Remove useless indirection for {backspace,delete}key resources. --- diff --git a/src/command.C b/src/command.C index 3096ce1c..d23e6127 100644 --- a/src/command.C +++ b/src/command.C @@ -561,7 +561,7 @@ rxvt_term::key_press (XKeyEvent &ev) kbuf[1] = '\0'; } else - strcpy (kbuf, key_backspace); + strcpy (kbuf, rs[Rs_backspace_key]); break; #endif #ifndef NO_DELETE_KEY @@ -576,7 +576,7 @@ rxvt_term::key_press (XKeyEvent &ev) /* FALLTHROUGH */ # endif case XK_Delete: - strcpy (kbuf, key_delete); + strcpy (kbuf, rs[Rs_delete_key]); break; #endif case XK_Tab: diff --git a/src/init.C b/src/init.C index 460ec138..fb8e0b6d 100644 --- a/src/init.C +++ b/src/init.C @@ -267,7 +267,6 @@ const char ** rxvt_term::init_resources (int argc, const char *const *argv) { int i, r_argc; - char *val; const char **cmd_argv, **r_argv; /* @@ -397,29 +396,19 @@ rxvt_term::init_resources (int argc, const char *const *argv) #ifndef NO_BACKSPACE_KEY if (!rs[Rs_backspace_key]) # ifdef DEFAULT_BACKSPACE - key_backspace = DEFAULT_BACKSPACE; + rs[Rs_backspace_key] = DEFAULT_BACKSPACE; # else - key_backspace = "DEC"; /* can toggle between \010 or \177 */ + rs[Rs_backspace_key] = "DEC"; /* can toggle between \010 or \177 */ # endif - else - { - val = strdup (rs[Rs_backspace_key]); - key_backspace = val; - } #endif #ifndef NO_DELETE_KEY if (!rs[Rs_delete_key]) # ifdef DEFAULT_DELETE - key_delete = DEFAULT_DELETE; + rs[Rs_delete_key] = DEFAULT_DELETE; # else - key_delete = "\033[3~"; + rs[Rs_delete_key] = "\033[3~"; # endif - else - { - val = strdup (rs[Rs_delete_key]); - key_delete = val; - } #endif #ifdef HAVE_SCROLLBARS @@ -640,7 +629,7 @@ rxvt_term::init_command (const char *const *argv) priv_modes |= PrivMode_smoothScroll; #ifndef NO_BACKSPACE_KEY - if (strcmp (key_backspace, "DEC") == 0) + if (strcmp (rs[Rs_backspace_key], "DEC") == 0) priv_modes |= PrivMode_HaveBackSpace; #endif @@ -1253,9 +1242,9 @@ rxvt_term::run_command (const char *const *argv) int er; #ifndef NO_BACKSPACE_KEY - if (key_backspace[0] && !key_backspace[1]) - er = key_backspace[0]; - else if (strcmp (key_backspace, "DEC") == 0) + if (rs[Rs_backspace_key][0] && !rs[Rs_backspace_key][1]) + er = rs[Rs_backspace_key][0]; + else if (strcmp (rs[Rs_backspace_key], "DEC") == 0) er = '\177'; /* the initial state anyway */ else #endif diff --git a/src/rxvt.h b/src/rxvt.h index e8f5e818..5e13c136 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1068,12 +1068,6 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { /* ---------- */ Cursor leftptr_cursor; /* ---------- */ -#ifndef NO_BACKSPACE_KEY - const char *key_backspace; -#endif -#ifndef NO_DELETE_KEY - const char *key_delete; -#endif struct mouse_event MEvent; XComposeStatus compose; ttymode_t tio;