diff options
author | Chris Johns <chrisj@rtems.org> | 2014-12-01 14:53:55 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-12-01 14:53:55 +1100 |
commit | e37e8504f1b53d01de49232dd5f1236bc518cd90 (patch) | |
tree | aeecec6ecfb243e6b8a737276c6f9ad49dd18e8c /cpukit | |
parent | score: Add heap statistics (diff) | |
download | rtems-e37e8504f1b53d01de49232dd5f1236bc518cd90.tar.bz2 |
libmisc/shell: Edit history hack is corrupting memory. Remove it.
The hack was a debug aid and is not needed.
Close #2203.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libmisc/shell/main_edit.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/cpukit/libmisc/shell/main_edit.c b/cpukit/libmisc/shell/main_edit.c index d105e20079..079e9ff73d 100644 --- a/cpukit/libmisc/shell/main_edit.c +++ b/cpukit/libmisc/shell/main_edit.c @@ -219,16 +219,6 @@ struct env { int untitled; // Counter for untitled files }; -/* - * This is a hack to allow a simple way to inspect the keys to - * add extar decoding. It is not multi-user safe. - */ -#define KEY_HISTORY 1 -#if KEY_HISTORY -int key_history[32]; -size_t key_history_in; -#endif - // // Editor buffer functions // @@ -813,19 +803,6 @@ static void get_modifier_keys(int *shift, int *ctrl) { static int getachar(void) { int ch = getchar(); -#if KEY_HISTORY - if (key_history_in < sizeof(key_history)) { - key_history[key_history_in++] = ch; -#if defined(__rtems__) - } if (key_history_in > sizeof(key_history)) { - /* eliminate possibility of using index above array bounds */ - assert( key_history_in > sizeof(key_history)); -#endif - } else { - memmove(&key_history[0], &key_history[1], sizeof(key_history) - sizeof(key_history[0])); - key_history[key_history_in - 1] = ch; - } -#endif return ch; } @@ -2155,7 +2132,7 @@ static void edit(struct editor *ed) { #endif #if defined(__rtems__) /* - * Coverity spotted this as using ed after free() so changing + * Coverity spotted this as using ed after free() so changing * the order of the statements. */ case ctrl('w'): ed = ed->env->current; close_editor(ed); break; |