Import patch from vendor (taken from nvi-1.81.5) that fixes problematic

interaction between the leftright and number options.

PR:		bin/23912
Reported by:	"Stephen D. Spencer" <gladiatr@boneyard.lawrence.ks.us>
Obtained from:	skimo@kotnet.org
This commit is contained in:
sheldonh 2002-01-07 14:26:12 +00:00
parent a0f3c80b90
commit fa30b82df1

View File

@ -111,6 +111,15 @@ vs_columns(sp, lp, lno, cnop, diffp)
int ch, leftright, listset;
char *p;
/*
* Initialize the screen offset.
*/
scno = 0;
/* Leading number if O_NUMBER option set. */
if (O_ISSET(sp, O_NUMBER))
scno += O_NUMBER_LENGTH;
/* Need the line to go any further. */
if (lp == NULL) {
(void)db_get(sp, lno, 0, &lp, &len);
@ -122,7 +131,7 @@ vs_columns(sp, lp, lno, cnop, diffp)
if (lp == NULL) {
done: if (diffp != NULL) /* XXX */
*diffp = 0;
return (0);
return scno;
}
/* Store away the values of the list and leftright edit options. */
@ -130,15 +139,10 @@ done: if (diffp != NULL) /* XXX */
leftright = O_ISSET(sp, O_LEFTRIGHT);
/*
* Initialize the pointer into the buffer and screen and current
* offsets.
* Initialize the pointer into the buffer and current offset.
*/
p = lp;
curoff = scno = 0;
/* Leading number if O_NUMBER option set. */
if (O_ISSET(sp, O_NUMBER))
scno += O_NUMBER_LENGTH;
curoff = 0;
/* Macro to return the display length of any signal character. */
#define CHLEN(val) (ch = *(u_char *)p++) == '\t' && \