* use modulo operation, Mr Glockner

* allow promptlen to return values > $COLUMNS
This commit is contained in:
tg
2006-08-01 14:35:44 +00:00
parent ce18e01f2c
commit a15c5c319a
2 changed files with 31 additions and 15 deletions

4
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.26 2006/08/01 14:10:24 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.27 2006/08/01 14:35:43 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -1241,7 +1241,7 @@ x_emacs(char *buf, size_t len)
x_adj_ok = 1;
prompt_redraw = 1;
if (x_col > xx_cols)
x_col = x_col - (x_col / xx_cols) * xx_cols;
x_col %= xx_cols;
x_displen = xx_cols - 2 - x_col;
x_adj_done = 0;