X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftty%2Flib_mvcur.c;h=8de26c4f6a80800937e550f83f8f34acc78b5b5d;hb=cabcc699fe87c3982b795dabea1ba6970b4faa90;hp=5e29c62ff175ef0924c11fec0e00525398404603;hpb=f79b52fddd95c7a6f1ead29ef9c39eb8cdf60795;p=ncurses.git diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 5e29c62f..8de26c4f 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.124 2010/12/19 01:22:58 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.127 2011/10/22 16:09:52 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -242,8 +242,9 @@ NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcn if (!GetNoPadding(SP_PARM)) #endif cum_cost += number * 10; - } else + } else if (SP_PARM) { cum_cost += (float) SP_PARM->_char_padding; + } } return ((int) cum_cost); @@ -469,7 +470,7 @@ NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0) /* leave cursor at screen bottom */ TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0); - if (SP_PARM && !IsTermInfo(SP_PARM)) + if (!SP_PARM || !IsTermInfo(SP_PARM)) return; /* set cursor to normal mode */ @@ -548,7 +549,7 @@ relative_move(NCURSES_SP_DCLx int from_x, int to_y, int to_x, - bool ovw) + int ovw) /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */ { string_desc save; @@ -769,7 +770,7 @@ relative_move(NCURSES_SP_DCLx */ static NCURSES_INLINE int -onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) +onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, int ovw) /* onscreen move from (yold, xold) to (ynew, xnew) */ { string_desc result;