delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/02/12:48:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <corinna-cygwin AT cygwin DOT com>
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
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  <ebb9 AT email DOT byu DOT edu>
> 
> 	* 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019