Mercurial > vim
comparison src/window.c @ 10377:dd397210a2d3 v8.0.0083
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 13 14:31:40 2016 +0100
patch 8.0.0083
Problem: Using freed memory with win_getid(). (Domenique Pelle)
Solution: For the current tab use curwin.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 Nov 2016 14:45:03 +0100 |
parents | 66f1b5bf3fa6 |
children | c9da7f9137af |
comparison
equal
deleted
inserted
replaced
10376:ba844c78f2af | 10377:dd397210a2d3 |
---|---|
7131 FOR_ALL_TABPAGES(tp) | 7131 FOR_ALL_TABPAGES(tp) |
7132 if (--tabnr == 0) | 7132 if (--tabnr == 0) |
7133 break; | 7133 break; |
7134 if (tp == NULL) | 7134 if (tp == NULL) |
7135 return -1; | 7135 return -1; |
7136 wp = tp->tp_firstwin; | 7136 if (tp == curtab) |
7137 wp = firstwin; | |
7138 else | |
7139 wp = tp->tp_firstwin; | |
7137 } | 7140 } |
7138 for ( ; wp != NULL; wp = wp->w_next) | 7141 for ( ; wp != NULL; wp = wp->w_next) |
7139 if (--winnr == 0) | 7142 if (--winnr == 0) |
7140 return wp->w_id; | 7143 return wp->w_id; |
7141 } | 7144 } |