Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site pixutl.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!harvard!wjh12!pixel!pixutl!chris
From: chris@pixutl.UUCP (chris)
Newsgroups: net.bugs.4bsd
Subject: Re: Bug with $cwd in 4.2BSD csh
Message-ID: <57@pixutl.UUCP>
Date: Mon, 8-Oct-84 12:09:10 EDT
Article-I.D.: pixutl.57
Posted: Mon Oct  8 12:09:10 1984
Date-Received: Tue, 9-Oct-84 20:11:47 EDT
References: <5299@yale.ARPA>
Distribution: net
Organization: Pixel Computer Inc., Wilmington, Mass.
Lines: 33


The following changes to 'sh.dir.c' will take care of the problem:

1) in dfollow(),
    1.1) add this declaration:
	char *realdname();
    1.2) before 'dcanon(cp);' insert:
	cp = realdname(cp);

2) then add this routine:

char *
realdname(d)
char *d;
{
	struct stat st;
	char *getwd();
	char path[BUFSIZ];

	lstat(d, &st);
	if((st.st_mode & S_IFMT) != S_IFLNK)
		return(d);
	printd = 1;
	return(savestr(getwd(path)));
}

-- 

 Chris Bertin            :         (617) 657-8720 x2318
 Pixel Computer Inc.     :
 260 Fordham Rd.         :  {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\
 Wilmington, Ma 01887    :     !wjh12!pixel!pixutl!chris