From frank@exit.com  Sun Dec 12 20:13:12 1999
Return-Path: <frank@exit.com>
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
Subject: vi screws up relative tag paths (with patch).
X-Send-Pr-Version: 3.2

>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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 12 20:20:02 PST 1999
>Closed-Date:    Sun Jun 17 01:03:19 PDT 2001
>Last-Modified:  Sun Jun 17 01:04:13 PDT 2001
>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 <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 = '/';
  	}
  }
  

>Release-Note:
>Audit-Trail:

From: Frank Mayhar <frank@exit.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/15450: The name of the tagfile is left in the path.
Date: Mon, 13 Dec 1999 10:26:04 -0800

 I've submitted the patch to Keith Bostic; hopefully he'll integrate it
 into
 the next version of nvi.  If someone could apply the patch to the nvi
 source, though, we could be a step ahead.  (It's a very simple patch, as
 you can see.)
 -- 
 Frank Mayhar frank@exit.com
 
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Sun Jun 17 01:03:19 PDT 2001 
State-Changed-Why:  
Duplicate of bin/13397. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15450 
>Unformatted:
