summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/glob.c')
-rw-r--r--lib/libc/gen/glob.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index c3d9f08..59663d9 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -5,6 +5,11 @@
* This code is derived from software contributed to Berkeley by
* Guido van Rossum.
*
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -751,6 +756,8 @@ match(Char *name, Char *pat, Char *patend)
{
int ok, negate_range;
Char c, k;
+ struct xlocale_collate *table =
+ (struct xlocale_collate*)__get_locale()->components[XLC_COLLATE];
while (pat < patend) {
c = *pat++;
@@ -775,10 +782,10 @@ match(Char *name, Char *pat, Char *patend)
++pat;
while (((c = *pat++) & M_MASK) != M_END)
if ((*pat & M_MASK) == M_RNG) {
- if (__collate_load_error ?
+ if (table->__collate_load_error ?
CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) :
- __collate_range_cmp(CHAR(c), CHAR(k)) <= 0
- && __collate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0
+ __collate_range_cmp(table, CHAR(c), CHAR(k)) <= 0
+ && __collate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0
)
ok = 1;
pat += 2;
OpenPOWER on IntegriCloud