bug in csh globbing (?) - (nf)

crl crl
Wed Mar 2 19:19:05 AEST 1983


#N:pur-phy:3700001:000:1471
pur-phy!crl    Mar  1 00:11:00 1983

I believe that I have found a bug in csh.  As we run a modified version
of 4.1 bsd csh on our 11/44, I'm not really sure which other versions
have the same problem.  I'm willing to bet that the 2.8 bsd and v7
ones have it also.

The reason that I'm unsure about it is that it has to do with the
8th bit of args.  It turned out that csh would not glob any filename
with a quoted (\) character in it.  For example, I use ',' as my 
history character and if I had a file in my directory called:
	foo.c,v
the command:
	echo *.c\,v
would fail with the message: "No match".

The problem I found was in the file sh.glob.c.  It turned out that 
in the globbing procedure, the 8th bit was not stripped off in the
comparison in amatch().  Comparison of this with Gmatch() confirmed
this--it strips the 8th bit first.

Was this done for any specific reason?  Does this "fix" botch some
other condition?  We have run this for about 2 weeks now with no
problem.  A diff -c follows.

Charles LaBrec
pur-ee!Physics:crl
purdue!Physics:crl

====================================================================
*** sh.glob.old	Tue Feb 15 00:59:11 1983
--- sh.glob.c	Tue Feb 15 00:59:17 1983
***************
*** 366,372
  			return (scc == 0);
  
  		default:
! 			if (c != scc)
  				return (0);
  			continue;
  

--- 366,373 -----
  			return (scc == 0);
  
  		default:
! 			/* this was bogus--quoted chars not matched */
! 			if ((c & TRIM) != scc)
  				return (0);
  			continue;
  




More information about the Net.bugs mailing list