Subject: bin/207: csh problems
To: None <gnats-admin>
From: None <thomas@mathematik.uni-Bremen.de>
List: netbsd-bugs
Date: 04/06/1994 15:35:10
>Number:         207
>Category:       bin
>Synopsis:       csh sometimes parses things wrong
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr  6 15:35:07 1994
>Originator:     Thomas Eberhardt
>Organization:
CeVis, University of Bremen, Germany
>Release:        
>Environment:
	
System: NetBSD ed209 0.9a ED209#0 i386

Machine: i386
>Description:
	csh sometimes parses things wrong.
>How-To-Repeat:
	relatively hard. seems to depend on a lot of circumstances.
>Fix:
I've got a fix from Andrew Cagney's <acagney@macadam.mpce.mq.edu.au>
NetBSD-0.9 patch set for AUIS-6.2.  After comparing things with the
tcsh-6.04 sources I've come up with the following patch that seems to
work for me:

*** dir.c-	Fri Dec 17 06:45:19 1993
--- dir.c	Wed Apr  6 04:10:18 1994
***************
*** 90,96 ****
  	    if (chdir(tcp) == -1)
  		cp = NULL;
  	    else
! 		cp = hp;
  	}
  	else
  	    cp = NULL;
--- 90,96 ----
  	    if (chdir(tcp) == -1)
  		cp = NULL;
  	    else
! 		cp = Strsave(hp);
  	}
  	else
  	    cp = NULL;
***************
*** 111,117 ****
  	if (hp && *hp &&
  	    stat(tcp, &swd) != -1 && stat(short2str(hp), &shp) != -1 &&
  	    swd.st_dev == shp.st_dev && swd.st_ino == shp.st_ino)
! 	    cp = hp;
  	else {
  	    char   *cwd;
  
--- 111,117 ----
  	if (hp && *hp &&
  	    stat(tcp, &swd) != -1 && stat(short2str(hp), &shp) != -1 &&
  	    swd.st_dev == shp.st_dev && swd.st_ino == shp.st_ino)
! 	    cp = Strsave(hp);
  	else {
  	    char   *cwd;
  
***************
*** 123,134 ****
  		    swd.st_ino == shp.st_ino)
  		    tcp = cwd;
  	    }
! 	    cp = dcanon(str2short(tcp), STRNULL);
  	}
      }
  
      dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
!     dp->di_name = Strsave(cp);
      dp->di_count = 0;
      dhead.di_next = dhead.di_prev = dp;
      dp->di_next = dp->di_prev = &dhead;
--- 123,134 ----
  		    swd.st_ino == shp.st_ino)
  		    tcp = cwd;
  	    }
! 	    cp = dcanon(SAVE(tcp), STRNULL);
  	}
      }
  
      dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
!     dp->di_name = cp;
      dp->di_count = 0;
      dhead.di_next = dhead.di_prev = dp;
      dp->di_next = dp->di_prev = &dhead;
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------