mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 03:20:28 +08:00
* path.cc (hash_path_name): Improve hash function strength.
This commit is contained in:
parent
6396bad848
commit
d055ecb08f
@ -1,3 +1,7 @@
|
|||||||
|
2002-04-30 Eric Blake <ebb9@email.byu.edu>
|
||||||
|
|
||||||
|
* path.cc (hash_path_name): Improve hash function strength.
|
||||||
|
|
||||||
2002-05-02 Robert Collins <rbtcollins@hotmail.com>
|
2002-05-02 Robert Collins <rbtcollins@hotmail.com>
|
||||||
|
|
||||||
* thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
|
* thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
|
||||||
|
@ -3182,7 +3182,7 @@ hash_path_name (unsigned long hash, const char *name)
|
|||||||
hash = cygheap->cwd.get_hash ();
|
hash = cygheap->cwd.get_hash ();
|
||||||
if (name[0] == '.' && name[1] == '\0')
|
if (name[0] == '.' && name[1] == '\0')
|
||||||
return hash;
|
return hash;
|
||||||
hash += hash_path_name (hash, "\\");
|
hash = (hash << 5) - hash + '\\';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3192,8 +3192,7 @@ hashit:
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
int ch = cyg_tolower(*name);
|
int ch = cyg_tolower(*name);
|
||||||
hash += ch + (ch << 17);
|
hash = (hash << 5) - hash + ch;
|
||||||
hash ^= hash >> 2;
|
|
||||||
}
|
}
|
||||||
while (*++name != '\0' &&
|
while (*++name != '\0' &&
|
||||||
!(*name == '\\' && (!name[1] || (name[1] == '.' && !name[2]))));
|
!(*name == '\\' && (!name[1] || (name[1] == '.' && !name[2]))));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user