[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-bugs
Subject: bin/23912: underflow of cnt in vs_paint() by O_NUMBER_LENGTH when both leftright and number options
From: gladiatr () boneyard ! lawrence ! ks ! us
Date: 2000-12-28 21:17:20
[Download RAW message or body]
> Number: 23912
> Category: bin
> Synopsis: underflow of cnt in vs_paint() by O_NUMBER_LENGTH when both \
> leftright and number options in use
> Confidential: no
> Severity: non-critical
> Priority: low
> Responsible: freebsd-bugs
> State: open
> Quarter:
> Keywords:
> Date-Required:
> Class: sw-bug
> Submitter-Id: current-users
> Arrival-Date: Thu Dec 28 13:20:01 PST 2000
> Closed-Date:
> Last-Modified:
> Originator: Stephen D. Spencer
> Release: 4.2
> Organization:
> Environment:
FreeBSD gandhi.eecs.ukans.edu 4.2-STABLE FreeBSD 4.2-STABLE #0: Mon Dec 18 09:41:03 \
CST 2000 sdspence@gandhi.eecs.ukans.edu:/usr/src/sys/compile/gandhi i386
> Description:
in versions of nvi including the newer development versions, if the
leftright and number options are both active, the editor will dive into
a not-quite-inifinite loop. in several seconds, it will return. if
the ruler option is active, it shows (1,4294967288). nvi remains
fairly useless from this point forward and must be sigkill'd
> How-To-Repeat:
vi /your/favorite/file that is long enough to require a page redraw
> set leftright
> set number
<Ctrl>F a few times... (croak)
> Fix:
this problem was traced back to vs_columns() returning a 0 value
regardless of whether or not the number option is being used.
according to vi/vi.h, #define O_NUMBER_LENGTH 8
which should be the offset returned when 'set number' is active so
that when the O_NUMBER_LENGH margin used for displaying the line number
is subtracted from the literal screen column, you will end up with
column '0' rather than 0xFFFFFFF8.
Please note, I have read the comments towards the last nvi bug report
that was submitted here and understand that nothing will be
done until the vendor commits the patch to their distribution. I
thought it would be nice in case someone else has tried these two
options in tandem and not had time to poke around to at least have a
manual recourse.
I have submitted a bug report to Keith Bostic. They are in the middle
of getting ready for a DB rollout, so it will be a while before he is
able to review the report.
--- vs_relative.c.orig Mon May 13 09:20:04 1996
+++ vs_relative.c Thu Dec 28 00:54:32 2000
@@ -122,7 +122,7 @@
if (lp == NULL) {
done: if (diffp != NULL) /* XXX */
*diffp = 0;
- return (0);
+ return (O_ISSET(sp, O_NUMBER) ? O_NUMBER_LENGTH : 0);
}
/* Store away the values of the list and leftright edit options. */
> Release-Note:
> Audit-Trail:
> Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic