Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Apr 1998 11:50:44 -0700 (PDT)
From:      Frank Mayhar <frank@exit.com>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Relative paths in tags files doesn't work in nvi.
Message-ID:  <199804231850.LAA06737@exit.com>

next in thread | raw e-mail | index | archive | help
If your tags file contains relative paths, nvi prepends the full path to
the tags file, instead of just the directory portion.  This is also found
in the regular nvi-1.79 distribution.  It's caused by a one-liner in
ex/ex_tag.c; here's the diff to fix it:

Index: ex_tag.c
===================================================================
RCS file: /cvs/repos/src/contrib/nvi/ex/ex_tag.c,v
retrieving revision 1.1.1.1.2.1
diff -c -r1.1.1.1.2.1 ex_tag.c
*** ex_tag.c	1997/04/20 20:15:02	1.1.1.1.2.1
--- ex_tag.c	1998/04/23 18:48:15
***************
*** 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 = '/';
  	}
  }
  
-- 
Frank Mayhar frank@exit.com

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?199804231850.LAA06737>