Source-Changes-HG archive

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

[src/trunk]: src/dist/nvi PR/45881: Chavdar Ivanov: nvi copy command copies e...



details:   https://anonhg.NetBSD.org/src/rev/60934114a932
branches:  trunk
changeset: 773082:60934114a932
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jan 27 16:41:22 2012 +0000

description:
PR/45881: Chavdar Ivanov: nvi copy command copies empty lines.
Move ENTIRE_LINE definition to common.h and have interested parties use it.

diffstat:

 dist/nvi/common/common.h |  3 ++-
 dist/nvi/common/cut.c    |  3 +--
 dist/nvi/common/delete.c |  4 ++--
 dist/nvi/ex/ex_move.c    |  4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diffs (70 lines):

diff -r d00efdaf4465 -r 60934114a932 dist/nvi/common/common.h
--- a/dist/nvi/common/common.h  Fri Jan 27 15:41:02 2012 +0000
+++ b/dist/nvi/common/common.h  Fri Jan 27 16:41:22 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.h,v 1.2 2008/05/20 17:38:19 aymeric Exp $ */
+/*     $NetBSD: common.h,v 1.3 2012/01/27 16:41:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -85,6 +85,7 @@
 /* Sequence types. */
 typedef enum { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT } seq_t;
 
+#define        ENTIRE_LINE     ((size_t)-1)
 /*
  * Local includes.
  */
diff -r d00efdaf4465 -r 60934114a932 dist/nvi/common/cut.c
--- a/dist/nvi/common/cut.c     Fri Jan 27 15:41:02 2012 +0000
+++ b/dist/nvi/common/cut.c     Fri Jan 27 16:41:22 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cut.c,v 1.8 2012/01/21 19:56:46 christos Exp $ */
+/*     $NetBSD: cut.c,v 1.9 2012/01/27 16:41:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -134,7 +134,6 @@
        }
 
 
-#define        ENTIRE_LINE     (size_t)-1
        /* In line mode, it's pretty easy, just cut the lines. */
        if (LF_ISSET(CUT_LINEMODE)) {
                cbp->flags |= CB_LMODE;
diff -r d00efdaf4465 -r 60934114a932 dist/nvi/common/delete.c
--- a/dist/nvi/common/delete.c  Fri Jan 27 15:41:02 2012 +0000
+++ b/dist/nvi/common/delete.c  Fri Jan 27 16:41:22 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: delete.c,v 1.5 2012/01/21 19:49:56 christos Exp $ */
+/*     $NetBSD: delete.c,v 1.6 2012/01/27 16:41:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -65,7 +65,7 @@
                if (tm->lno == lno) {
                        if (db_get(sp, lno, DBG_FATAL, &p, &len))
                                return (1);
-                       eof = tm->cno != (size_t)-1 && tm->cno >= len ? 1 : 0;
+                       eof = tm->cno != ENTIRE_LINE && tm->cno >= len ? 1 : 0;
                } else
                        eof = 1;
                if (eof) {
diff -r d00efdaf4465 -r 60934114a932 dist/nvi/ex/ex_move.c
--- a/dist/nvi/ex/ex_move.c     Fri Jan 27 15:41:02 2012 +0000
+++ b/dist/nvi/ex/ex_move.c     Fri Jan 27 16:41:22 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ex_move.c,v 1.1.1.2 2008/05/18 14:31:16 aymeric Exp $ */
+/*     $NetBSD: ex_move.c,v 1.2 2012/01/27 16:41:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -54,7 +54,7 @@
        memset(&cb, 0, sizeof(cb));
        CIRCLEQ_INIT(&cb.textq);
        for (cnt = fm1.lno; cnt <= fm2.lno; ++cnt)
-               if (cut_line(sp, cnt, 0, 0, &cb)) {
+               if (cut_line(sp, cnt, 0, ENTIRE_LINE, &cb)) {
                        rval = 1;
                        goto err;
                }



Home | Main Index | Thread Index | Old Index