aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-10-14 22:56:25 +0000
committerUlrich Drepper <drepper@redhat.com>2005-10-14 22:56:25 +0000
commit7d4722e3fd1c4205bba9fddf7a1de611d5151ebd (patch)
treead47ea3abe962721a12650a82287c317b7d681b6 /posix
parentdaa226125cf9570ac726e21fc33d19101123a5c0 (diff)
downloadglibc-7d4722e3fd1c4205bba9fddf7a1de611d5151ebd.tar
glibc-7d4722e3fd1c4205bba9fddf7a1de611d5151ebd.tar.gz
glibc-7d4722e3fd1c4205bba9fddf7a1de611d5151ebd.tar.bz2
glibc-7d4722e3fd1c4205bba9fddf7a1de611d5151ebd.zip
[BZ #368]
* SUPPORTED (SUPPORTED-LOCALES): Add dz_BT.UTF-8. [BZ #368] * locales/dz_BT: New file.
Diffstat (limited to 'posix')
-rw-r--r--posix/fnmatch_loop.c78
-rw-r--r--posix/regcomp.c37
2 files changed, 66 insertions, 49 deletions
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
index 449e5e02b4..02a4e9030c 100644
--- a/posix/fnmatch_loop.c
+++ b/posix/fnmatch_loop.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2003,2004
- Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2003,2004,2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -502,24 +502,31 @@ FCT (pattern, string, string_end, no_leading_period, flags)
idx = 0;
elem = hash % table_size;
- second = hash % (table_size - 2);
- while (symb_table[2 * elem] != 0)
+ if (symb_table[2 * elem] != 0)
{
- /* First compare the hashing value. */
- if (symb_table[2 * elem] == hash
- && c1 == extra[symb_table[2 * elem + 1]]
- && memcmp (str,
- &extra[symb_table[2 * elem + 1]
- + 1], c1) == 0)
+ second = hash % (table_size - 2) + 1;
+
+ do
{
- /* Yep, this is the entry. */
- idx = symb_table[2 * elem + 1];
- idx += 1 + extra[idx];
- break;
- }
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ && (c1
+ == extra[symb_table[2 * elem + 1]])
+ && memcmp (str,
+ &extra[symb_table[2 * elem
+ + 1]
+ + 1], c1) == 0)
+ {
+ /* Yep, this is the entry. */
+ idx = symb_table[2 * elem + 1];
+ idx += 1 + extra[idx];
+ break;
+ }
- /* Next entry. */
- elem += second;
+ /* Next entry. */
+ elem += second;
+ }
+ while (symb_table[2 * elem] != 0);
}
if (symb_table[2 * elem] != 0)
@@ -714,25 +721,30 @@ FCT (pattern, string, string_end, no_leading_period, flags)
idx = 0;
elem = hash % table_size;
- second = hash % (table_size - 2);
- while (symb_table[2 * elem] != 0)
+ if (symb_table[2 * elem] != 0)
{
- /* First compare the hashing value. */
- if (symb_table[2 * elem] == hash
- && (c1
- == extra[symb_table[2 * elem + 1]])
- && memcmp (str,
- &extra[symb_table[2 * elem + 1]
- + 1], c1) == 0)
+ second = hash % (table_size - 2) + 1;
+
+ do
{
- /* Yep, this is the entry. */
- idx = symb_table[2 * elem + 1];
- idx += 1 + extra[idx];
- break;
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ && (c1
+ == extra[symb_table[2 * elem + 1]])
+ && memcmp (str,
+ &extra[symb_table[2 * elem + 1]
+ + 1], c1) == 0)
+ {
+ /* Yep, this is the entry. */
+ idx = symb_table[2 * elem + 1];
+ idx += 1 + extra[idx];
+ break;
+ }
+
+ /* Next entry. */
+ elem += second;
}
-
- /* Next entry. */
- elem += second;
+ while (symb_table[2 * elem] != 0);
}
if (symb_table[2 * elem] != 0)
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 269d6a6b5f..d898574be1 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2742,23 +2742,28 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
{
int32_t hash = elem_hash ((const char *) name, name_len);
int32_t elem = hash % table_size;
- int32_t second = hash % (table_size - 2);
- while (symb_table[2 * elem] != 0)
- {
- /* First compare the hashing value. */
- if (symb_table[2 * elem] == hash
- /* Compare the length of the name. */
- && name_len == extra[symb_table[2 * elem + 1]]
- /* Compare the name. */
- && memcmp (name, &extra[symb_table[2 * elem + 1] + 1],
- name_len) == 0)
+ if (symb_table[2 * elem] != 0)
+ {
+ int32_t second = hash % (table_size - 2) + 1;
+
+ do
{
- /* Yep, this is the entry. */
- break;
- }
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ /* Compare the length of the name. */
+ && name_len == extra[symb_table[2 * elem + 1]]
+ /* Compare the name. */
+ && memcmp (name, &extra[symb_table[2 * elem + 1] + 1],
+ name_len) == 0)
+ {
+ /* Yep, this is the entry. */
+ break;
+ }
- /* Next entry. */
- elem += second;
+ /* Next entry. */
+ elem += second;
+ }
+ while (symb_table[2 * elem] != 0);
}
return elem;
}
@@ -3000,7 +3005,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
/*
if (MB_CUR_MAX > 1)
*/
- collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB);
symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_TABLEMB);