Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 2 May 2002 18:46:25 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Patch: Re: Bug in stat()? Message-ID: <20020502184625.A17594@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: <3CCEFEFB DOT 7F44402A AT email DOT byu DOT edu> <3CCF209A DOT FB2A1908 AT email DOT byu DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3CCF209A.FB2A1908@email.byu.edu> User-Agent: Mutt/1.3.22.1i On Tue, Apr 30, 2002 at 04:54:18PM -0600, Eric Blake wrote: > Eric Blake wrote: > > [...] > 2002-04-30 Eric Blake > > * path.cc (hash_path_name): Improve hash function strength. > > $ diff -u path.cc.bak path.cc > --- path.cc.bak Tue Apr 30 16:32:52 2002 > +++ path.cc Tue Apr 30 16:40:14 2002 > @@ -3136,7 +3136,7 @@ > hash = cygheap->cwd.get_hash (); > if (name[0] == '.' && name[1] == '\0') > return hash; > - hash += hash_path_name (hash, "\\"); > + hash = (hash << 5) - hash + '\\'; > } > } > > @@ -3146,8 +3146,7 @@ > do > { > int ch = cyg_tolower(*name); > - hash += ch + (ch << 17); > - hash ^= hash >> 2; > + hash = (hash << 5) - hash + ch; > } > while (*++name != '\0' && > !(*name == '\\' && (!name[1] || (name[1] == '.' && !name[2])))); > Thanks for that patch. I've applied it. Check out the next developers snapshot. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/