From owner-freebsd-bugs Mon Jan 21 11:50:27 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1693C37B419 for ; Mon, 21 Jan 2002 11:50:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0LJo1a07505; Mon, 21 Jan 2002 11:50:01 -0800 (PST) (envelope-from gnats) Received: from lion-around.at.yiff.net (lion-around.at.yiff.net [167.206.208.229]) by hub.freebsd.org (Postfix) with ESMTP id 78C1537B400 for ; Mon, 21 Jan 2002 11:43:48 -0800 (PST) Received: (from chris@localhost) by lion-around.at.yiff.net (8.11.6/8.11.6) id g0LJhUZ08799; Mon, 21 Jan 2002 14:43:30 -0500 (EST) (envelope-from chris) Message-Id: <200201211943.g0LJhUZ08799@lion-around.at.yiff.net> Date: Mon, 21 Jan 2002 14:43:30 -0500 (EST) From: Christopher Masto Reply-To: Christopher Masto To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: gnu/34128: sdiff "e" doesn't work with some editors Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34128 >Category: gnu >Synopsis: sdiff "e" doesn't work with some editors >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 21 11:50:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Christopher Masto >Release: FreeBSD 4.4-STABLE i386 >Organization: >Environment: System: FreeBSD lion-around.at.yiff.net 4.4-STABLE FreeBSD 4.4-STABLE #0: Tue Oct 9 13:36:55 EDT 2001 root@lion-around.at.yiff.net:/usr/obj/usr/src/sys/LION-AROUND i386 >Description: When using sdiff, one of the options is to edit the left, right, both or a new file. The implementation creates a temporary file, runs an editor on it, then seeks back to the beginning and reads the results. Unfortunately, this doesn't work with some editors, principally emacs, which do not rewrite the original file but instead write a new file and then rename it into place. sdiff still has the old file open and won't read any of the changes. There is no warning or notice that this is happening, and it can lead to serious corruption of files. Since sdiff is an integral part of the mergemaster process, this is likely to bite people who are upgrading. >How-To-Repeat: With EDITOR set to emacs or xemacs, use the edit option within sdiff. The following is sufficient: chris@lion-around:~/tmp/sdiff$ echo 1 > one; echo 2 > two; sdiff -o out one two 1 | 2 %e l [emacs starts with "1" in the buffer. Change it to anything, save, and exit.] chris@lion-around:~/tmp/sdiff$ cat out 1 Note that the change silently disappeared. >Fix: sdiff should reopen the file after the editor exits. It should probably also notice if no changes were made, and prompt/warn the user. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message