mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.0820: memory leak with empty shell command
Problem: Memory leak with empty shell command. Solution: Free the empty string.
This commit is contained in:
parent
03d6e6f42b
commit
86e6717ace
@ -3330,4 +3330,6 @@ EXTERN char e_loop_nesting_too_deep[]
|
|||||||
INIT(= N_("E1306: Loop nesting too deep"));
|
INIT(= N_("E1306: Loop nesting too deep"));
|
||||||
EXTERN char e_argument_nr_trying_to_modify_const_str[]
|
EXTERN char e_argument_nr_trying_to_modify_const_str[]
|
||||||
INIT(= N_("E1307: Argument %d: Trying to modify a const %s"));
|
INIT(= N_("E1307: Argument %d: Trying to modify a const %s"));
|
||||||
|
EXTERN char e_cannot_resize_window_in_another_tab_page[]
|
||||||
|
INIT(= N_("E1308: Cannot resize a window in another tab page"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -914,6 +914,11 @@ f_win_move_statusline(typval_T *argvars, typval_T *rettv)
|
|||||||
wp = find_win_by_nr_or_id(&argvars[0]);
|
wp = find_win_by_nr_or_id(&argvars[0]);
|
||||||
if (wp == NULL || win_valid_popup(wp))
|
if (wp == NULL || win_valid_popup(wp))
|
||||||
return;
|
return;
|
||||||
|
if (!win_valid(wp))
|
||||||
|
{
|
||||||
|
emsg(_(e_cannot_resize_window_in_another_tab_page));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
offset = (int)tv_get_number(&argvars[1]);
|
offset = (int)tv_get_number(&argvars[1]);
|
||||||
win_drag_status_line(wp, offset);
|
win_drag_status_line(wp, offset);
|
||||||
|
@ -1545,23 +1545,33 @@ func Test_win_move_statusline()
|
|||||||
call assert_true(id->win_move_statusline(-offset))
|
call assert_true(id->win_move_statusline(-offset))
|
||||||
call assert_equal(h, winheight(id))
|
call assert_equal(h, winheight(id))
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
" check that win_move_statusline doesn't error with offsets beyond moving
|
" check that win_move_statusline doesn't error with offsets beyond moving
|
||||||
" possibility
|
" possibility
|
||||||
call assert_true(win_move_statusline(id, 5000))
|
call assert_true(win_move_statusline(id, 5000))
|
||||||
call assert_true(winheight(id) > h)
|
call assert_true(winheight(id) > h)
|
||||||
call assert_true(win_move_statusline(id, -5000))
|
call assert_true(win_move_statusline(id, -5000))
|
||||||
call assert_true(winheight(id) < h)
|
call assert_true(winheight(id) < h)
|
||||||
|
|
||||||
" check that win_move_statusline returns false for an invalid window
|
" check that win_move_statusline returns false for an invalid window
|
||||||
wincmd =
|
wincmd =
|
||||||
let h = winheight(0)
|
let h = winheight(0)
|
||||||
call assert_false(win_move_statusline(-1, 1))
|
call assert_false(win_move_statusline(-1, 1))
|
||||||
call assert_equal(h, winheight(0))
|
call assert_equal(h, winheight(0))
|
||||||
|
|
||||||
" check that win_move_statusline returns false for a popup window
|
" check that win_move_statusline returns false for a popup window
|
||||||
let id = popup_create(['hello', 'world'], {})
|
let id = popup_create(['hello', 'world'], {})
|
||||||
let h = winheight(id)
|
let h = winheight(id)
|
||||||
call assert_false(win_move_statusline(id, 1))
|
call assert_false(win_move_statusline(id, 1))
|
||||||
call assert_equal(h, winheight(id))
|
call assert_equal(h, winheight(id))
|
||||||
call popup_close(id)
|
call popup_close(id)
|
||||||
|
|
||||||
|
" check that using another tabpage fails without crash
|
||||||
|
let id = win_getid()
|
||||||
|
tabnew
|
||||||
|
call assert_fails('call win_move_statusline(id, -1)', 'E1308:')
|
||||||
|
tabclose
|
||||||
|
|
||||||
%bwipe!
|
%bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
821,
|
||||||
/**/
|
/**/
|
||||||
820,
|
820,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user