another off-by-one, reported by «macaronyde:#!/bin/mksh»

This commit is contained in:
tg 2009-03-17 13:56:47 +00:00
parent d99541d7c8
commit d8c3d6e9c1
3 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.260 2009/03/16 15:50:11 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.261 2009/03/17 13:56:46 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R36 2009/03/15
@(#)MIRBSD KSH R36 2009/03/17
description:
Check version of shell.
stdin:

6
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.155 2009/03/15 18:48:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.156 2009/03/17 13:56:47 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -2242,12 +2242,12 @@ x_redraw(int limit)
x_flush();
if (xbp == xbuf) {
x_col = promptlen(prompt);
if (x_col > xx_cols)
if (x_col >= xx_cols)
x_trunc = (x_col / xx_cols) * xx_cols;
if (prompt_redraw)
pprompt(prompt, x_trunc);
}
if (x_col > xx_cols)
if (x_col >= xx_cols)
x_col %= xx_cols;
x_displen = xx_cols - 2 - x_col;
if (x_displen < 1) {

4
sh.h
View File

@ -102,9 +102,9 @@
#define __SCCSID(x) __IDSTRING(sccsid,x)
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.278 2009/03/16 15:50:13 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.279 2009/03/17 13:56:45 tg Exp $");
#endif
#define MKSH_VERSION "R36 2009/03/15"
#define MKSH_VERSION "R36 2009/03/17"
#ifndef MKSH_INCLUDES_ONLY