diff --git a/builtin_set.cpp b/builtin_set.cpp index 0cd8044a3..c1bb65ccc 100644 --- a/builtin_set.cpp +++ b/builtin_set.cpp @@ -264,6 +264,10 @@ static int update_values( wcstring_list_t &list, { return 1; } + if ( ind >= list.size() ) + { + list.resize( ind+1 ); + } // free((void *) al_get(list, ind)); list[ ind ] = newv; diff --git a/output.cpp b/output.cpp index 96030c5d5..ac6db73ac 100644 --- a/output.cpp +++ b/output.cpp @@ -280,7 +280,8 @@ void set_color(rgb_color_t c, rgb_color_t c2) Background is set */ bg_set=1; - c = (c2==rgb_color_t::white())?rgb_color_t::black():rgb_color_t::white(); + if ( c==c2 ) + c = (c2==rgb_color_t::white())?rgb_color_t::black():rgb_color_t::white(); } if( (enter_bold_mode != 0) && (strlen(enter_bold_mode) > 0))