From c4e88acd83b716f72a39ded22c0ed92c5d7b8d5a Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 7 Dec 2012 23:46:38 +0000 Subject: [PATCH] =?UTF-8?q?Correct=20mistake=20when=20doing=20hashtable=20?= =?UTF-8?q?lookup=20collision=20resolution=E2=80=A6=20oops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 6 +++--- main.c | 6 +++--- sh.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/check.t b/check.t index b97fa97..9e0a86b 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.572 2012/12/07 23:43:09 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.573 2012/12/07 23:46:33 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -29,7 +29,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R41 2012/12/05 + @(#)MIRBSD KSH R41 2012/12/07 description: Check version of shell. stdin: @@ -38,7 +38,7 @@ name: KSH_VERSION category: shell:legacy-no --- expected-stdout: - @(#)LEGACY KSH R41 2012/12/05 + @(#)LEGACY KSH R41 2012/12/07 description: Check version of legacy shell. stdin: diff --git a/main.c b/main.c index cee112f..5d1769b 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/main.c,v 1.247 2012/12/05 19:38:21 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/main.c,v 1.248 2012/12/07 23:46:36 tg Exp $"); extern char **environ; @@ -1654,7 +1654,7 @@ tgrow(struct table *tp) if ((tblp = otblp[i]) != NULL) { if ((tblp->flag & DEFINED)) { /* search for free hash table slot */ - j = (perturb = tblp->ua.hval) & mask; + j = perturb = tblp->ua.hval; goto find_first_empty_slot; find_next_empty_slot: j = (j << 2) + j + perturb + 1; @@ -1692,7 +1692,7 @@ ktscan(struct table *tp, const char *name, uint32_t h, struct tbl ***ppp) mask = ((size_t)1 << (tp->tshift)) - 1; /* search for hash table slot matching name */ - j = (perturb = h) & mask; + j = perturb = h; goto find_first_slot; find_next_slot: j = (j << 2) + j + perturb + 1; diff --git a/sh.h b/sh.h index 726ba37..b207a1b 100644 --- a/sh.h +++ b/sh.h @@ -152,9 +152,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.614 2012/12/05 19:38:23 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.615 2012/12/07 23:46:38 tg Exp $"); #endif -#define MKSH_VERSION "R41 2012/12/05" +#define MKSH_VERSION "R41 2012/12/07" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES