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: <20030216112012.L9084@cackle.proxima.alt.za> References: <20030215174605.I9084@cackle.proxima.alt.za> <0043a6a833ad0d4ab1079c5a650c3b23@collyer.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <0043a6a833ad0d4ab1079c5a650c3b23@collyer.net>; from Geoff Collyer on Sat, Feb 15, 2003 at 03:56:28PM -0800 Date: Sun, 16 Feb 2003 11:20:13 +0200 Topicbox-Message-UUID: 62715774-eacb-11e9-9e20-41e7f4b1d025 On Sat, Feb 15, 2003 at 03:56:28PM -0800, Geoff Collyer wrote: > > echo */. > > would work on Unix, but on Plan 9 matches all files in the current directory > (fallout from use of cleanname, perhaps?). However, > A small fix to my hack: while(Readdir(f, namep, dironly||namep[1]!=0)){ ^^^^^^^^^^^^^ (adding a check for a trailing component) has the dual effect of fixing the above inconsistency and, hopefully, speed up the expansion by considering only directories if there is a subsequent component. There may be implications I have overlooked. I think the code should be revised, if the objective seems worthwhile, rather than hacked, but that's a decision for the _real_ developers. ++L