]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - hashlib.c
Bash-4.4 patch 4
[thirdparty/bash.git] / hashlib.c
index 456272ac1adfa04c1dfe1d7e7ca9437995a85de9..e23641c3236a536c78b94766833c25b25334a931 100644 (file)
--- a/hashlib.c
+++ b/hashlib.c
@@ -1,22 +1,22 @@
 /* hashlib.c -- functions to manage and access hash tables for bash. */
 
-/* Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1987,1989,1991,1995,1998,2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc.
 
-This file is part of GNU Bash, the Bourne Again SHell.
+   This file is part of GNU Bash, the Bourne Again SHell.
 
-Bash is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
+   Bash is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
-Bash is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
+   Bash is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
-with Bash; see the file COPYING.  If not, write to the Free Software
-Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+   You should have received a copy of the GNU General Public License
+   along with Bash.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 #include <config.h>
 
@@ -177,8 +177,9 @@ hash_search (string, table, flags)
 
   bucket = HASH_BUCKET (string, table, hv);
 
-  for (list = table->bucket_array[bucket]; list; list = list->next)
+  for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list; list = list->next)
     {
+      /* This is the comparison function */
       if (hv == list->khash && STREQ (list->key, string))
        {
          list->times_found++;
@@ -402,13 +403,22 @@ fatal_error (const char *format, ...)
   abort();
 }
 
+void
+internal_warning (const char *format, ...)
+{
+}
+
 main ()
 {
   char string[256];
   int count = 0;
   BUCKET_CONTENTS *tt;
 
+#if defined (TEST_NBUCKETS)
+  table = hash_create (TEST_NBUCKETS);
+#else
   table = hash_create (0);
+#endif
 
   for (;;)
     {