From: Paolo Bonzini Date: Thu, 09 Jul 2009 22:36:35 GMT Subject: Re: [PATCH 4/3] Avoid using 'lstat()' to figure out directories Message-ID: <4A5670F3.9020309@gnu.org> In-Reply-To: > + if (ce->name[len]> '/') > + break; > + if (ce->name[len]< '/') > + continue; What about if (ce->name[len] < '/') { if (strchr(ce->name + len + 1, '/')) break; else continue; } to just punt if we'd go into a directory? I'm not much worried about accessing foo-0001, foo-0002, foo-0003 while looking for foo/a (that would be O(number of files in a directory), which is bearable), but risking to go down a huge subtree is not very nice. Paolo