summaryrefslogtreecommitdiff
path: root/editors/nvi-devel
diff options
context:
space:
mode:
authorDima Dorfman <dd@FreeBSD.org>2001-07-09 22:33:14 +0000
committerDima Dorfman <dd@FreeBSD.org>2001-07-09 22:33:14 +0000
commitec155e2e4936a1c711f83ad39ed4a5460cca2dc4 (patch)
treeaa68d74669440e24f0e5b7db87268c2d1d613c44 /editors/nvi-devel
parentAdd "DOCSDIR=${PREFIX}/share/doc/${PORTNAME}" so every port in the world (diff)
Remove my hack and replace it with a better, more correct patch from
the vendor.
Notes
Notes: svn path=/head/; revision=44979
Diffstat (limited to 'editors/nvi-devel')
-rw-r--r--editors/nvi-devel/files/patch-lr-num19
-rw-r--r--editors/nvi-devel/files/patch-vi-relative57
2 files changed, 57 insertions, 19 deletions
diff --git a/editors/nvi-devel/files/patch-lr-num b/editors/nvi-devel/files/patch-lr-num
deleted file mode 100644
index acad5ed93860..000000000000
--- a/editors/nvi-devel/files/patch-lr-num
+++ /dev/null
@@ -1,19 +0,0 @@
-# This fixes an infinite loop in the case of:
-#
-# :set leftright
-# :set number
-#
-# See PR 28687. Patch has been submitted to maintainer.
-
-diff -ru nvi-1.81.4.orig/vi/vs_refresh.c nvi-1.81.4/vi/vs_refresh.c
---- nvi-1.81.4.orig/vi/vs_refresh.c Wed Jul 19 10:05:20 2000
-+++ nvi-1.81.4/vi/vs_refresh.c Sat Jul 7 16:11:51 2001
-@@ -573,7 +573,7 @@
- * for the number option offset.
- */
- cnt = vs_columns(sp, NULL, LNO, &CNO, NULL);
-- if (O_ISSET(sp, O_NUMBER))
-+ if (O_ISSET(sp, O_NUMBER) && cnt >= O_NUMBER_LENGTH)
- cnt -= O_NUMBER_LENGTH;
-
- /* Adjust the window towards the beginning of the line. */
diff --git a/editors/nvi-devel/files/patch-vi-relative b/editors/nvi-devel/files/patch-vi-relative
new file mode 100644
index 000000000000..735dc464c03d
--- /dev/null
+++ b/editors/nvi-devel/files/patch-vi-relative
@@ -0,0 +1,57 @@
+# Vendor patch to fix FreeBSD PR 28687.
+
+diff -ru nvi-1.81.4.orig/vi/vs_relative.c nvi-1.81.4/vi/vs_relative.c
+--- nvi-1.81.4.orig/vi/vs_relative.c Wed Jul 19 10:05:20 2000
++++ nvi-1.81.4/vi/vs_relative.c Mon Jul 9 15:26:39 2001
+@@ -10,7 +10,7 @@
+ #include "config.h"
+
+ #ifndef lint
+-static const char sccsid[] = "$Id: vs_relative.c,v 10.16 2000/07/19 17:05:20 skimo Exp $ (Berkeley) $Date: 2000/07/19 17:05:20 $";
++static const char sccsid[] = "$Id: vs_relative.c,v 10.18 2001/07/08 13:02:48 skimo Exp $ (Berkeley) $Date: 2001/07/08 13:02:48 $";
+ #endif /* not lint */
+
+ #include <sys/types.h>
+@@ -111,6 +111,15 @@
+ int ch, leftright, listset;
+ CHAR_T *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 @@
+ 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 @@
+ 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 = *(UCHAR_T *)p++) == '\t' && \