Skip site navigation (1)Skip section navigation (2)
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:   bin/15450: vi screws up relative tag paths (with patch).
Message-ID:  <199912130413.UAA06415@realtime.exit.com>

next in thread | raw e-mail | index | archive | help

>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 <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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" 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>