From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucio De Re To: 9fans@cse.psu.edu Subject: Re: [9fans] Ugly hack Message-ID: <20030216144558.O9084@cackle.proxima.alt.za> References: <20030215174605.I9084@cackle.proxima.alt.za> <0043a6a833ad0d4ab1079c5a650c3b23@collyer.net> <20030216112012.L9084@cackle.proxima.alt.za> <20030216112527.M9084@cackle.proxima.alt.za> <20030216141859.N9084@cackle.proxima.alt.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20030216141859.N9084@cackle.proxima.alt.za>; from Lucio De Re on Sun, Feb 16, 2003 at 02:18:59PM +0200 Date: Sun, 16 Feb 2003 14:45:58 +0200 Topicbox-Message-UUID: 6289dd62-eacb-11e9-9e20-41e7f4b1d025 On Sun, Feb 16, 2003 at 02:18:59PM +0200, Lucio De Re wrote: > > > And here's one that actually doesn't break globbing: > > term% diff glob.c `{yesterday glob.c} > 69c69 > < while(Readdir(f, namep, dironly||*newp=='/')){ > --- > > while(Readdir(f, namep, dironly)){ > term% > OK, after this, I ought to shut up. *newp=='/' suffices to determine the value to be passed to the modified Readdir() function. This means that "dironly" within glob.c can be eliminated entirely. The following patch based on the original glob.c is much simpler: term% diff glob.c /n/dump/2003/0215/sys/src/cmd/rc/glob.c 64c64 < /* read the directory and recurse for any entry that matches */ --- > /* read the directory and recur for any entry that matches */ 68c68 < while(Readdir(f, namep, *newp=='/')){ --- > while(Readdir(f, namep)){ term% Please forgive all the previous noise. ++L