Subject: csh bug (which)
To: None <current-users@NetBSD.ORG>
From: Henry G. Juengst, PIB <juengst@saph1.physik.uni-bonn.de>
List: current-users
Date: 05/23/1995 17:37:23
Small bug in csh "which":

#!/bin/csh
which /bin/csh

Result: .//bin/csh
Fix:
*** /usr/src/bin/csh/exec.c.orig	Wed Mar 22 11:49:51 1995
--- /usr/src/bin/csh/exec.c	Tue May 23 04:16:24 1995
***************
*** 723,731 ****
  	while (--i)
  	    pv++;
  	if (pv[0][0] == 0 || eq(pv[0], STRdot)) {
! 	    sp->word = Strspl(STRdotsl, sp->word);
  	    prlex(cshout, lex);
! 	    xfree((ptr_t) sp->word);
  	    sp->word = s0;	/* we save and then restore this */
  	    return;
  	}
--- 723,733 ----
  	while (--i)
  	    pv++;
  	if (pv[0][0] == 0 || eq(pv[0], STRdot)) {
! 	    if(!slash)
! 	      sp->word = Strspl(STRdotsl, sp->word);
  	    prlex(cshout, lex);
! 	    if(!slash)
! 	      xfree((ptr_t) sp->word);
  	    sp->word = s0;	/* we save and then restore this */
  	    return;
  	}