Date: Sun, 12 Dec 1999 20:13:01 -0800 (PST) From: frank@exit.com To: FreeBSD-gnats-submit@freebsd.org Cc: hackers@freebsd.org Subject: vi screws up relative tag paths (with patch). Message-ID: <199912130413.UAA06415@realtime.exit.com>
next in thread | raw e-mail | index | archive | help
>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 <existing tag>".
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912130413.UAA06415>
