Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-04-08 16:21:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2004-04-08 16:21:15 +0400
commit6eee18ea6e55b33da482df2c34ddb9547751e49a (patch)
treea46a440cf6512a305b146896cd62c2fc3866ec5b /winsup
parenta9a5b2eab006f3479087bed7030a16b86cd791aa (diff)
* path.cc (hash_path_name): Replace hash algorithm with SDBM.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/path.cc4
2 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bfbb95f5a..f3e681745 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,4 +1,8 @@
-2004-04-07 Corinna Vinschen <corinna@vinschen.de>
+2004-04-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * path.cc (hash_path_name): Replace hash algorithm with SDBM.
+
+2004-04-08 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Set query access mode according
to query_open setting.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 0ece42dd9..847fbd0c6 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3262,7 +3262,7 @@ hash_path_name (__ino64_t hash, const char *name)
hash = cygheap->cwd.get_hash ();
if (name[0] == '.' && name[1] == '\0')
return hash;
- hash = (hash << 5) - hash + '\\';
+ hash = '\\' + (hash << 6) + (hash << 16) - hash;
}
}
@@ -3272,7 +3272,7 @@ hashit:
do
{
int ch = cyg_tolower (*name);
- hash = (hash << 5) - hash + ch;
+ hash = ch + (hash << 6) + (hash << 16) - hash;
}
while (*++name != '\0' &&
!(*name == '\\' && (!name[1] || (name[1] == '.' && !name[2]))));