repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: f4ed0134392afa5ae3ae7ca9a51504d47a66fbe3: path_to: revision_to:
commit f4ed0134392afa5ae3ae7ca9a51504d47a66fbe3 Author: Emanuele GiaquintaDate: Sun Sep 9 10:14:40 2007 +0000 Remove useless indirection for {backspace,delete}key resources. diff --git a/src/command.C b/src/command.C
--- 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
--- 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
--- 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;
-----END OF PAGE-----