NetBSD Problem Report #45881

From www@NetBSD.org  Fri Jan 27 14:53:46 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 19D8B63DE12
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 27 Jan 2012 14:53:46 +0000 (UTC)
Message-Id: <20120127145345.7576C63DE10@www.NetBSD.org>
Date: Fri, 27 Jan 2012 14:53:45 +0000 (UTC)
From: ci@delcam.com
Reply-To: ci@delcam.com
To: gnats-bugs@NetBSD.org
Subject: nvi copy command copies empty lines.
X-Send-Pr-Version: www-1.0

>Number:         45881
>Category:       bin
>Synopsis:       nvi copy command copies empty lines.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 27 14:55:00 +0000 2012
>Closed-Date:    Sun Apr 22 19:09:24 +0000 2012
>Last-Modified:  Sun Apr 22 19:09:24 +0000 2012
>Originator:     Chavdar Ivanov
>Release:        5.99.60
>Organization:
Delcam Plc
>Environment:
# uname -a
NetBSD support6 5.99.60 NetBSD 5.99.60 (MYDOMU) #0: Tue Jan 24 14:04:01 GMT 2012  root@support6:/usr/src/sys/arch/amd64/compile/MYDOMU amd64
>Description:
1: new file: line 1
:a
1
2
3
4
5
.
:2,4m$
4
:1,$p
1
5
2
3
4
:1,3co$

:1,$p
1
5
2
3
4



:wq
1: new file: 8 lines, 13 characters
[uksup2] ~ $ cat 1
1
5
2
3
4



[uksup2] ~ $ 

>How-To-Repeat:
Use ex copy command, see the transcript above.
>Fix:
--- dist/nvi/ex/ex_move.c.ORIG       2008-05-18 15:31:16.000000000 +0100
+++ dist/nvi/ex/ex_move.c       2012-01-27 14:34:59.000000000 +0000
@@ -25,6 +25,7 @@
 #include <string.h>

 #include "../common/common.h"
+#define ENTIRE_LINE     (size_t)-1

 /*
  * ex_copy -- :[line [,line]] co[py] line [flags]
@@ -54,7 +55,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;
                }

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45881 CVS commit: src/dist/nvi
Date: Fri, 27 Jan 2012 11:41:23 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Fri Jan 27 16:41:23 UTC 2012

 Modified Files:
 	src/dist/nvi/common: common.h cut.c delete.c
 	src/dist/nvi/ex: ex_move.c

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


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/common.h
 cvs rdiff -u -r1.8 -r1.9 src/dist/nvi/common/cut.c
 cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/common/delete.c
 cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/ex/ex_move.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 22 Apr 2012 19:09:24 +0000
State-Changed-Why:
Christos fixed it in January.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.