vt_buf.c (271973) | vt_buf.c (274860) |
---|---|
1/*- 2 * Copyright (c) 2009, 2013 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Ed Schouten under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Portions of this software were developed by Oleksandr Rybalko --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009, 2013 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Ed Schouten under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Portions of this software were developed by Oleksandr Rybalko --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: stable/10/sys/dev/vt/vt_buf.c 271973 2014-09-22 16:13:33Z dumbbell $"); | 34__FBSDID("$FreeBSD: stable/10/sys/dev/vt/vt_buf.c 274860 2014-11-22 16:55:55Z dumbbell $"); |
35 36#include <sys/param.h> 37#include <sys/kernel.h> 38#include <sys/lock.h> 39#include <sys/malloc.h> 40#include <sys/mutex.h> 41#include <sys/reboot.h> 42#include <sys/systm.h> --- 514 unchanged lines hidden (view full) --- 557 if (!history_was_full && vb->vb_curroffset > 0) { 558 vb->vb_curroffset = vb->vb_curroffset + h - p->tp_row; 559 if (vb->vb_curroffset < 0) 560 vb->vb_curroffset += vb->vb_history_size; 561 vb->vb_curroffset %= vb->vb_history_size; 562 vb->vb_roffset = vb->vb_curroffset; 563 } 564 | 35 36#include <sys/param.h> 37#include <sys/kernel.h> 38#include <sys/lock.h> 39#include <sys/malloc.h> 40#include <sys/mutex.h> 41#include <sys/reboot.h> 42#include <sys/systm.h> --- 514 unchanged lines hidden (view full) --- 557 if (!history_was_full && vb->vb_curroffset > 0) { 558 vb->vb_curroffset = vb->vb_curroffset + h - p->tp_row; 559 if (vb->vb_curroffset < 0) 560 vb->vb_curroffset += vb->vb_history_size; 561 vb->vb_curroffset %= vb->vb_history_size; 562 vb->vb_roffset = vb->vb_curroffset; 563 } 564 |
565 /* Adjust cursor position. */ 566 if (vb->vb_cursor.tp_col > p->tp_col - 1) 567 /* 568 * Move cursor to the last column, in case its previous 569 * position is outside of the new screen area. 570 */ 571 vb->vb_cursor.tp_col = p->tp_col - 1; 572 573 if (vb->vb_curroffset > 0 || vb->vb_cursor.tp_row > p->tp_row - 1) 574 /* Move cursor to the last line on the screen. */ 575 vb->vb_cursor.tp_row = p->tp_row - 1; 576 |
|
565 vtbuf_make_undirty(vb); 566 VTBUF_UNLOCK(vb); 567 568 /* Deallocate old buffer. */ 569 free(old, M_VTBUF); 570 free(oldrows, M_VTBUF); 571} 572 --- 224 unchanged lines hidden --- | 577 vtbuf_make_undirty(vb); 578 VTBUF_UNLOCK(vb); 579 580 /* Deallocate old buffer. */ 581 free(old, M_VTBUF); 582 free(oldrows, M_VTBUF); 583} 584 --- 224 unchanged lines hidden --- |