aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tty/lib_mvcur.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/tty/lib_mvcur.c')
-rw-r--r--contrib/ncurses/ncurses/tty/lib_mvcur.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/ncurses/ncurses/tty/lib_mvcur.c b/contrib/ncurses/ncurses/tty/lib_mvcur.c
index 9eca0269390e..955eb8c6cd84 100644
--- a/contrib/ncurses/ncurses/tty/lib_mvcur.c
+++ b/contrib/ncurses/ncurses/tty/lib_mvcur.c
@@ -153,7 +153,7 @@
#include <term.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_mvcur.c,v 1.57 1999/06/26 22:16:04 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.60 1999/10/03 01:08:27 Alexander.V.Lukyanov Exp $")
#define STRLEN(s) (s != 0) ? strlen(s) : 0
@@ -246,10 +246,10 @@ int _nc_msec_cost(const char *const cap, int affcnt)
{
if (isdigit(*cp))
number = number * 10 + (*cp - '0');
- else if (*cp == '.')
- number += (*++cp - 10) / 10.0;
else if (*cp == '*')
number *= affcnt;
+ else if (*cp == '.' && (*++cp != '>') && isdigit(*cp))
+ number += (*cp - '0') / 10.0;
}
cum_cost += number * 10;
@@ -734,6 +734,7 @@ onscreen_mvcur(int yold,int xold,int ynew,int xnew, bool ovw)
{
char use[OPT_SIZE], *sp;
int tactic = 0, newcost, usecost = INFINITY;
+ int t5_cr_cost;
#if defined(MAIN) || defined(NCURSES_TEST)
struct timeval before, after;
@@ -817,13 +818,14 @@ onscreen_mvcur(int yold,int xold,int ynew,int xnew, bool ovw)
* tactic #5: use left margin for wrap to right-hand side,
* unless strange wrap behavior indicated by xenl might hose us.
*/
+ t5_cr_cost = (xold>0 ? SP->_cr_cost : 0);
if (auto_left_margin && !eat_newline_glitch
&& yold > 0 && cursor_left
&& ((newcost=relative_move(NULL, yold-1, screen_columns-1, ynew, xnew, ovw)) != INFINITY)
- && SP->_cr_cost + SP->_cub1_cost + newcost + newcost < usecost)
+ && t5_cr_cost + SP->_cub1_cost + newcost < usecost)
{
tactic = 5;
- usecost = SP->_cr_cost + SP->_cub1_cost + newcost;
+ usecost = t5_cr_cost + SP->_cub1_cost + newcost;
}
/*