Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/vi/common Fix a test condition for EOF. Together wit...



details:   https://anonhg.NetBSD.org/src/rev/eb97ce3fdb54
branches:  trunk
changeset: 514716:eb97ce3fdb54
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Sun Sep 09 11:03:02 2001 +0000

description:
Fix a test condition for EOF. Together with previous commit in cut.c (1.4),
this fixes correctly PR #10367.

diffstat:

 usr.bin/vi/common/delete.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r ff784891a903 -r eb97ce3fdb54 usr.bin/vi/common/delete.c
--- a/usr.bin/vi/common/delete.c        Sun Sep 09 11:01:09 2001 +0000
+++ b/usr.bin/vi/common/delete.c        Sun Sep 09 11:03:02 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: delete.c,v 1.3 2001/03/31 11:37:45 aymeric Exp $       */
+/*     $NetBSD: delete.c,v 1.4 2001/09/09 11:03:02 aymeric Exp $       */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -68,7 +68,7 @@
                if (tm->lno == lno) {
                        if (db_get(sp, lno, DBG_FATAL, &p, &len))
                                return (1);
-                       eof = tm->cno >= len ? 1 : 0;
+                       eof = tm->cno != -1 && tm->cno >= len ? 1 : 0;
                } else
                        eof = 1;
                if (eof) {



Home | Main Index | Thread Index | Old Index