From owner-freebsd-bugs Sun Dec 12 20:20: 9 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id DCB5E14D7C for ; Sun, 12 Dec 1999 20:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA74122; Sun, 12 Dec 1999 20:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from tinker.exit.com (exit-gw.power.net [207.151.46.196]) by hub.freebsd.org (Postfix) with ESMTP id 7637F14DA5; Sun, 12 Dec 1999 20:13:06 -0800 (PST) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime.exit.com [206.223.0.5]) by tinker.exit.com (8.9.3/8.9.3) with ESMTP id UAA01172; Sun, 12 Dec 1999 20:13:01 -0800 (PST) (envelope-from frank@exit.com) Received: (from frank@localhost) by realtime.exit.com (8.9.3/8.9.3) id UAA06415; Sun, 12 Dec 1999 20:13:01 -0800 (PST) (envelope-from frank) Message-Id: <199912130413.UAA06415@realtime.exit.com> Date: Sun, 12 Dec 1999 20:13:01 -0800 (PST) From: frank@exit.com Reply-To: frank@exit.com To: FreeBSD-gnats-submit@freebsd.org Cc: hackers@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/15450: vi screws up relative tag paths (with patch). Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15450 >Category: bin >Synopsis: The name of the tagfile is left in the path. >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 12 20:20:02 PST 1999 >Closed-Date: >Last-Modified: >Originator: Frank Mayhar >Release: FreeBSD 3.4-RC i386 >Organization: Subversive Atheists -R- Us >Environment: 3.4-RC, 4.0-current, etc. >Description: The routine ctag_file(), when constructing the path to the file from a relative path in the tagfile, leaves the name of the tagfile in the path. >How-To-Repeat: Create a tagfile with relative entries, go to a different directory, and do a "vi -t ". >Fix: Index: ex_tag.c =================================================================== RCS file: /cvs/repos/src/contrib/nvi/ex/ex_tag.c,v retrieving revision 1.2 diff -c -r1.2 ex_tag.c *** ex_tag.c 1997/04/18 23:36:43 1.2 --- ex_tag.c 1999/06/25 20:59:29 *************** *** 1339,1349 **** stat(name, &sb) && (p = strrchr(tfp->name, '/')) != NULL) { *p = '\0'; len = snprintf(buf, sizeof(buf), "%s/%s", tfp->name, name); - *p = '/'; if (stat(buf, &sb) == 0) { *dirp = tfp->name; *dlenp = strlen(*dirp); } } } --- 1339,1349 ---- stat(name, &sb) && (p = strrchr(tfp->name, '/')) != NULL) { *p = '\0'; len = snprintf(buf, sizeof(buf), "%s/%s", tfp->name, name); if (stat(buf, &sb) == 0) { *dirp = tfp->name; *dlenp = strlen(*dirp); } + *p = '/'; } } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message