From owner-freebsd-hackers Sun Dec 12 20:13:15 1999 Delivered-To: freebsd-hackers@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) Date: Sun, 12 Dec 1999 20:13:01 -0800 (PST) Message-Id: <199912130413.UAA06415@realtime.exit.com> To: FreeBSD-gnats-submit@freebsd.org Subject: vi screws up relative tag paths (with patch). From: frank@exit.com Cc: hackers@freebsd.org Reply-To: frank@exit.com X-send-pr-version: 3.2 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >Submitter-Id: current-users >Originator: Frank Mayhar >Organization: Subversive Atheists -R- Us >Confidential: no >Synopsis: The name of the tagfile is left in the path. >Severity: serious >Priority: high >Category: bin >Release: FreeBSD 3.4-RC i386 >Class: sw-bug >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 = '/'; } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message