From owner-freebsd-ports Sun May 27 22:10: 6 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 90EA437B423 for ; Sun, 27 May 2001 22:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4S5A1w92507; Sun, 27 May 2001 22:10:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E5B4C37B423 for ; Sun, 27 May 2001 22:03:15 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4S53Fv86800; Sun, 27 May 2001 22:03:15 -0700 (PDT) (envelope-from nobody) Message-Id: <200105280503.f4S53Fv86800@freefall.freebsd.org> Date: Sun, 27 May 2001 22:03:15 -0700 (PDT) From: bpederson@geocities.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: ports/27700: editors/nano 1.0.2 cut/paste patch needed Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 27700 >Category: ports >Synopsis: editors/nano 1.0.2 cut/paste patch needed >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 27 22:10:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Barry Pederson >Release: 4.2 Release >Organization: >Environment: >Description: nano 1.0.1 and 1.0.2 have a bug in which cutting and pasting works incorrectly. See http://sourceforge.net/tracker/index.php?func=detail&aid=423389&group_id=1304&atid=101304 for details. Patch below is from the sourceforge website. >How-To-Repeat: Given these two paragraphs of random characters: -------- asdf asd f asdf sadf sdf asf weqw e wqe qwe qwe qwe qw e xc zxc c zxc zxc z xcz xc asdf asd f asdf sadf sdf asf weqw e wqe qwe qwe qwe qw e xc zxc c zxc zxc z xcz xc --------- Place the cursor on the first lone 'f', hit Ctrl-^ to start marking, down-arrow to the next line, Ctrl-K to cut, and then Ctrl-U to uncut, what gets pasted back is wrong (it should look like the second paragraph, which was identical to begin with) If you then go down to the second paragraph, and repeat the cutting, a message: "Nano in free(): warning chunk is already free." appears mixed in with the text. >Fix: diff -u -r1.27.2.3 cut.c --- cut.c 2001/05/10 22:55:16 1.27.2.3 +++ cut.c 2001/05/17 03:39:40 @@ -61,7 +61,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot, int bot_x) { - filestruct *tmp, *next; + filestruct *tmp, *next, *botcopy; char *tmpstr; /* Set up the beginning of the cutbuffer */ @@ -103,7 +103,15 @@ * up a newline when we're grabbing the last line of the mark. For * the same reason, we don't do an extra totsize decrement. */ - add_to_cutbuffer(bot); + + /* I honestly do not know why this is needed. After many hours of + using gdb on an OpenBSD box, I can honestly say something is + screwed somewhere. Not doing this causes update_line to annihilate + the last line copied into the cutbuffer when the mark is set ?!?!? */ + botcopy = copy_node(bot); + add_to_cutbuffer(botcopy); + free(bot); + top->next = next; if (next != NULL) next->prev = top; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message