diff options
Diffstat (limited to 'cpukit/libmisc/shell/main_edit.c')
-rw-r--r-- | cpukit/libmisc/shell/main_edit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/libmisc/shell/main_edit.c b/cpukit/libmisc/shell/main_edit.c index 0feb828c31..a73bc0d2c0 100644 --- a/cpukit/libmisc/shell/main_edit.c +++ b/cpukit/libmisc/shell/main_edit.c @@ -2147,7 +2147,15 @@ static void edit(struct editor *ed) { case ctrl('s'): save_editor(ed); break; case ctrl('p'): pipe_command(ed); break; #endif +#if defined(__rtems__) + /* + * 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; +#else case ctrl('w'): close_editor(ed); ed = ed->env->current; break; +#endif } } } |