[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r3737 - in /fsf/trunk/libc: ./ include/bits/ locale/ locale/programs/ localedata/ localedata/locales/ misc/ misc/bits/ posix...



Author: eglibc
Date: Mon Oct  8 00:04:48 2007
New Revision: 3737

Log:
Import glibc-mainline for 2007-10-08

Added:
    fsf/trunk/libc/include/bits/error.h
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/locale/C-time.c
    fsf/trunk/libc/locale/programs/ld-time.c
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/nb_NO
    fsf/trunk/libc/localedata/locales/nn_NO
    fsf/trunk/libc/misc/bits/error.h
    fsf/trunk/libc/misc/error.h
    fsf/trunk/libc/posix/glob.c
    fsf/trunk/libc/posix/tst-gnuglob.c
    fsf/trunk/libc/wcsmbs/wchar.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Oct  8 00:04:48 2007
@@ -1,3 +1,27 @@
+2007-10-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #181]
+	* locale/C-time.c: Set week_1stday data to 19971201.
+	* locale/programs/ld-time.c (time_finish): Default for
+	first_workday is Monday.
+
+	[BZ #2633]
+	* wcsmbs/wchar.h: Move many C99 functions into std namespace.
+
+	[BZ #5103]
+	* posix/glob.c (glob): Recognize patterns starting \/.
+	* posix/tst-gnuglob.c (find_file): Handle absolute path names.
+	(main): Add test for pattern starting \/.
+
+	* misc/error.h: Use __const instead of const.
+	* misc/bits/error.h: Likewise.
+
+2007-10-07  Andreas Jaeger  <aj@xxxxxxx>
+
+	* include/bits/error.h: New file.
+
+	* misc/bits/error.h (error_at_line): Fix prototype.
+
 2007-10-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #3924]

Added: fsf/trunk/libc/include/bits/error.h
==============================================================================
--- fsf/trunk/libc/include/bits/error.h (added)
+++ fsf/trunk/libc/include/bits/error.h Mon Oct  8 00:04:48 2007
@@ -1,0 +1,1 @@
+#include "../../misc/bits/error.h"

Modified: fsf/trunk/libc/locale/C-time.c
==============================================================================
--- fsf/trunk/libc/locale/C-time.c (original)
+++ fsf/trunk/libc/locale/C-time.c Mon Oct  8 00:04:48 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2002, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1995.
 
@@ -134,7 +134,7 @@
     { .wstr = (const uint32_t *) L"" },
     { .wstr = (const uint32_t *) L"" },
     { .string = "\7" },
-    { .word = 19971130 },
+    { .word = 19971201 },
     { .string = "\4" },
     { .string = "\7" },
     { .string = "\1" },

Modified: fsf/trunk/libc/locale/programs/ld-time.c
==============================================================================
--- fsf/trunk/libc/locale/programs/ld-time.c (original)
+++ fsf/trunk/libc/locale/programs/ld-time.c Mon Oct  8 00:04:48 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1995.
 
@@ -508,7 +508,7 @@
 
   if (time->first_workday == '\0')
     /* The definition does not specify this so the default is used.  */
-    time->first_workday = 1;
+    time->first_workday = 2;
   else if (time->first_workday > time->week_ndays)
     WITH_CUR_LOCALE (error (0, 0, _("\
 %s: values for field `%s' must not be larger than %d"),

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Mon Oct  8 00:04:48 2007
@@ -1,3 +1,10 @@
+2007-10-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #73]
+	* locales/nb_NO: Update time information, collation, thousands
+	separator.
+	* locales/nn_NO: Likewise.
+
 2007-10-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* locales/en_NG: New file.

Modified: fsf/trunk/libc/localedata/locales/nb_NO
==============================================================================
--- fsf/trunk/libc/localedata/locales/nb_NO (original)
+++ fsf/trunk/libc/localedata/locales/nb_NO Mon Oct  8 00:04:48 2007
@@ -15,15 +15,13 @@
 % Date: 1996-10-15
 % Application: general
 % Users: general
-% Repertoiremap: mnemonic.ds
-% Charset: ISO-8859-1
 % Distribution and use is free, also
 % for commercial purposes.
 
 LC_IDENTIFICATION
 title      "Norwegian (Bokmal) locale for Norway"
 source     "Norsk Standardiseringsforbund"
-address    "University Library,, Drammensveien 41, N-9242 Oslo, Norge"
+address    "University Library, Drammensveien 41, N-9242 Oslo, Norge"
 contact    ""
 email      "bug-glibc-locales@xxxxxxx"
 tel        ""
@@ -66,6 +64,9 @@
 <CAP-MIN>
 <MIN-CAP>
 
+reorder-after <OBL>
+<ETH>
+
 reorder-after <z>
 <ae>
 <o-stroke>
@@ -73,31 +74,33 @@
 
 reorder-after <U0178>
 <U00DC> <y>;<U00DC>;<CAP>;IGNORE
+<U0170> <y>;<U0170>;<CAP>;IGNORE
+reorder-after <U00FF>
 <U00FC> <y>;<U00DC>;<MIN>;IGNORE
-<U0170> <y>;<U0170>;<CAP>;IGNORE
 <U0171> <y>;<U0170>;<MIN>;IGNORE
 
 reorder-after <U017B>
 <U00C6> <ae>;<BAS>;<CAP>;IGNORE
-<U00E6> <ae>;<BAS>;<MIN>;IGNORE
 <U01FC> <ae>;<ACA>;<CAP>;IGNORE
-<U01FD> <ae>;<ACA>;<MIN>;IGNORE
 <U01E2> <ae>;<MAC>;<CAP>;IGNORE
-<U01E3> <ae>;<MAC>;<MIN>;IGNORE
 <U00C4> <ae>;<PCL>;<CAP>;IGNORE
-<U00E4> <ae>;<PCL>;<MIN>;IGNORE
 <U00D8> <o-stroke>;<BAS>;<CAP>;IGNORE
-<U00F8> <o-stroke>;<BAS>;<MIN>;IGNORE
 <U01FE> <o-stroke>;<ACA>;<CAP>;IGNORE
-<U01FF> <o-stroke>;<ACA>;<MIN>;IGNORE
 <U00D6> <o-stroke>;<REU>;<CAP>;IGNORE
-<U00F6> <o-stroke>;<REU>;<MIN>;IGNORE
 <U0150> <o-stroke>;<DAC>;<CAP>;IGNORE
-<U0151> <o-stroke>;<DAC>;<MIN>;IGNORE
 <U00C5> <a-ring>;<BAS>;<CAP>;IGNORE
-<U00E5> <a-ring>;<BAS>;<MIN>;IGNORE
 <A-A>   <a-ring>;<A-A>;<CAP>;IGNORE
 <A-a>   <a-ring>;<A-A>;<CAP-MIN>;IGNORE
+reorder-after <U017C>
+<U00E6> <ae>;<BAS>;<MIN>;IGNORE
+<U01FD> <ae>;<ACA>;<MIN>;IGNORE
+<U01E3> <ae>;<MAC>;<MIN>;IGNORE
+<U00E4> <ae>;<PCL>;<MIN>;IGNORE
+<U00F8> <o-stroke>;<BAS>;<MIN>;IGNORE
+<U01FF> <o-stroke>;<ACA>;<MIN>;IGNORE
+<U00F6> <o-stroke>;<REU>;<MIN>;IGNORE
+<U0151> <o-stroke>;<DAC>;<MIN>;IGNORE
+<U00E5> <a-ring>;<BAS>;<MIN>;IGNORE
 <a-A>   <a-ring>;<A-A>;<MIN-CAP>;IGNORE
 <a-a>   <a-ring>;<A-A>;<MIN>;IGNORE
 
@@ -105,15 +108,14 @@
 %  removed from latest iso14651 tables.
 reorder-after <U0162>
 <U00DE> "<t><h>";"<LIG><LIG>";"<CAP><CAP>";IGNORE
+reorder-after <U0163>
 <U00FE> "<t><h>";"<LIG><LIG>";"<MIN><MIN>";IGNORE
-
-reorder-after <OBL>
-<ETH>
 
 reorder-after <U0064>
 <U0110> <d>;<OBL>;<CAP>;IGNORE
+<U00D0> <d>;<ETH>;<CAP>;IGNORE
+reorder-after <U0044>
 <U0111> <d>;<OBL>;<MIN>;IGNORE
-<U00D0> <d>;<ETH>;<CAP>;IGNORE
 <U00F0> <d>;<ETH>;<MIN>;IGNORE
 
 reorder-end
@@ -132,7 +134,7 @@
 int_curr_symbol         "<U004E><U004F><U004B><U0020>"
 currency_symbol         "<U006B><U0072>"
 mon_decimal_point       "<U002C>"
-mon_thousands_sep       "<U002E>"
+mon_thousands_sep       "<U00A0>"
 mon_grouping            3;3
 positive_sign           ""
 negative_sign           "<U002D>"
@@ -148,15 +150,15 @@
 
 LC_NUMERIC
 decimal_point           "<U002C>"
-thousands_sep           "<U002E>"
+thousands_sep           "<U00A0>"
 grouping                3;3
 END LC_NUMERIC
 
 LC_TIME
-abday       "<U0073><U00F8><U006E>";"<U006D><U0061><U006E>";/
-            "<U0074><U0069><U0072>";"<U006F><U006E><U0073>";/
-            "<U0074><U006F><U0072>";"<U0066><U0072><U0065>";/
-            "<U006C><U00F8><U0072>"
+abday       "<U0073><U00F8><U002E>";"<U006D><U0061><U002E>";/
+            "<U0074><U0069><U002E>";"<U006F><U006E><U002E>";/
+            "<U0074><U006F><U002E>";"<U0066><U0072><U002E>";/
+            "<U006C><U00F8><U002E>"
 day         "<U0073><U00F8><U006E><U0064><U0061><U0067>";/
             "<U006D><U0061><U006E><U0064><U0061><U0067>";/
             "<U0074><U0069><U0072><U0073><U0064><U0061><U0067>";/
@@ -164,12 +166,12 @@
             "<U0074><U006F><U0072><U0073><U0064><U0061><U0067>";/
             "<U0066><U0072><U0065><U0064><U0061><U0067>";/
             "<U006C><U00F8><U0072><U0064><U0061><U0067>"
-abmon       "<U006A><U0061><U006E>";"<U0066><U0065><U0062>";/
-            "<U006D><U0061><U0072>";"<U0061><U0070><U0072>";/
-            "<U006D><U0061><U0069>";"<U006A><U0075><U006E>";/
-            "<U006A><U0075><U006C>";"<U0061><U0075><U0067>";/
-            "<U0073><U0065><U0070>";"<U006F><U006B><U0074>";/
-            "<U006E><U006F><U0076>";"<U0064><U0065><U0073>"
+abmon       "<U006A><U0061><U006E><U002E>";"<U0066><U0065><U0062><U002E>";/
+            "<U006D><U0061><U0072><U0073>";"<U0061><U0070><U0072><U0069><U006C>";/
+            "<U006D><U0061><U0069>";"<U006A><U0075><U006E><U0069>";/
+            "<U006A><U0075><U006C><U0069>";"<U0061><U0075><U0067><U002E>";/
+            "<U0073><U0065><U0070><U002E>";"<U006F><U006B><U0074><U002E>";/
+            "<U006E><U006F><U0076><U002E>";"<U0064><U0065><U0073><U002E>"
 mon         "<U006A><U0061><U006E><U0075><U0061><U0072>";/
             "<U0066><U0065><U0062><U0072><U0075><U0061><U0072>";/
             "<U006D><U0061><U0072><U0073>";/
@@ -183,14 +185,22 @@
             "<U006E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
             "<U0064><U0065><U0073><U0065><U006D><U0062><U0065><U0072>"
 % usual date representation
-d_t_fmt     "<U0025><U0061><U0020><U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
-d_fmt       "<U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0059>"
-t_fmt       "<U0025><U0054>"
+% %a %d. %b %Y kl. %H.%M %z
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U002E><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U006B><U006C><U002E><U0020><U0025><U0048>/
+<U002E><U0025><U004D><U0020><U0025><U007A>"
+% %d. %b %Y
+d_fmt  "<U0025><U0064><U002E><U0020><U0025><U0062><U0020><U0025><U0059>"
+% kl. %H.%M %z
+t_fmt        "<U006B><U006C><U002E><U0020><U0025><U0048><U002E><U0025>/
+<U004D><U0020><U0025><U007A>"
 am_pm       "";""
 t_fmt_ampm  ""
-date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
-<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
-<U0025><U005A><U0020><U0025><U0059>"
+% %a %d. %b %H:%M:%S %z %Y
+date_fmt       "<U0025><U0061><U0020><U0025><U0064><U002E><U0020><U0025>/
+<U0062><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U007A><U0020><U0025><U0059>"
+
 week    7;19971201;4
 first_weekday 1
 first_workday 1

Modified: fsf/trunk/libc/localedata/locales/nn_NO
==============================================================================
--- fsf/trunk/libc/localedata/locales/nn_NO (original)
+++ fsf/trunk/libc/localedata/locales/nn_NO Mon Oct  8 00:04:48 2007
@@ -75,27 +75,27 @@
 % for IBM Class for Unicode/Java
 %
 % Abbreviated weekday names (%a)
-abday       "<U0073><U0075><U0020>";"<U006D><U00E5><U0020>";/
-            "<U0074><U0079><U0020>";"<U006F><U006E><U0020>";/
-            "<U0074><U006F><U0020>";"<U0066><U0072><U0020>";/
-            "<U006C><U0061><U0075><U0020>"
+abday       "<U0073><U0075><U002E>";"<U006D><U00E5><U002E>";/
+            "<U0074><U0079><U002E>";"<U006F><U006E><U002E>";/
+            "<U0074><U006F><U002E>";"<U0066><U0072><U002E>";/
+            "<U006C><U0061><U002E>"
 %
 % Full weekday names (%A)
-day         "<U0073><U0075><U006E><U0064><U0061><U0067><U0020>";/
-            "<U006D><U00E5><U006E><U0064><U0061><U0067><U0020>";/
-            "<U0074><U0079><U0073><U0064><U0061><U0067><U0020>";/
-            "<U006F><U006E><U0073><U0064><U0061><U0067><U0020>";/
-            "<U0074><U006F><U0072><U0073><U0064><U0061><U0067><U0020>";/
-            "<U0066><U0072><U0065><U0064><U0061><U0067><U0020>";/
-            "<U006C><U0061><U0075><U0072><U0064><U0061><U0067><U0020>"
+day         "<U0073><U0075><U006E><U0064><U0061><U0067> ";/
+            "<U006D><U00E5><U006E><U0064><U0061><U0067> ";/
+            "<U0074><U0079><U0073><U0064><U0061><U0067> ";/
+            "<U006F><U006E><U0073><U0064><U0061><U0067> ";/
+            "<U0074><U006F><U0072><U0073><U0064><U0061><U0067> ";/
+            "<U0066><U0072><U0065><U0064><U0061><U0067> ";/
+            "<U006C><U0061><U0075><U0072><U0064><U0061><U0067> "
 %
 % Abbreviated month names (%b)
-abmon       "<U006A><U0061><U006E>";"<U0066><U0065><U0062>";/
-            "<U006D><U0061><U0072>";"<U0061><U0070><U0072>";/
-            "<U006D><U0061><U0069>";"<U006A><U0075><U006E>";/
-            "<U006A><U0075><U006C>";"<U0061><U0075><U0067>";/
-            "<U0073><U0065><U0070>";"<U006F><U006B><U0074>";/
-            "<U006E><U006F><U0076>";"<U0064><U0065><U0073>"
+abmon       "<U006A><U0061><U006E><U002E>";"<U0066><U0065><U0062><U002E>";/
+            "<U006D><U0061><U0072><U0073>";"<U0061><U0070><U0072><U0069><U006C>";/
+            "<U006D><U0061><U0069>";"<U006A><U0075><U006E><U0069>";/
+            "<U006A><U0075><U006C><U0069>";"<U0061><U0075><U0067><U002E>";/
+            "<U0073><U0065><U0070><U002E>";"<U006F><U006B><U0074><U002E>";/
+            "<U006E><U006F><U0076><U002E>";"<U0064><U0065><U0073><U002E>"
 %
 % Full month names (%B)
 mon         "<U006A><U0061><U006E><U0075><U0061><U0072>";/
@@ -110,32 +110,24 @@
             "<U006F><U006B><U0074><U006F><U0062><U0065><U0072>";/
             "<U006E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
             "<U0064><U0065><U0073><U0065><U006D><U0062><U0065><U0072>"
-%
-% Equivalent of AM PM
+
+% usual date representation
+% %a %d. %b %Y kl. %H.%M %z
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U002E><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U006B><U006C><U002E><U0020><U0025><U0048>/
+<U002E><U0025><U004D><U0020><U0025><U007A>"
+% %d. %b %Y
+d_fmt  "<U0025><U0064><U002E><U0020><U0025><U0062><U0020><U0025><U0059>"
+% kl. %H.%M %z
+t_fmt        "<U006B><U006C><U002E><U0020><U0025><U0048><U002E><U0025>/
+<U004D><U0020><U0025><U007A>"
 am_pm       "";""
-%
-% Appropriate date and time representation
-% %d. %b %Ykl %H.%M %Z
-d_t_fmt     "<U0025><U0064><U002E><U0020><U0025><U0062><U0020><U0025>/
-<U0059><U0020><U006B><U006C><U0020><U0025><U0048><U002E><U0025><U004D>/
-<U0020><U0025><U005A>"
-%
-% Appropriate date representation
-% %d. %b %Y
-d_fmt       "<U0025><U0064><U002E><U0020><U0025><U0062><U0020><U0025><U0059>"
-%
-% Appropriate time representation
-% kl %H.%M %Z
-t_fmt       "<U006B><U006C><U0020><U0025><U0048><U002E><U0025><U004D>/
-<U0020><U0025><U005A>"
-%
-% Appropriate 12 h time representation (%r)
 t_fmt_ampm  ""
-%
-% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
-<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
-<U0025><U005A><U0020><U0025><U0059>"
+% %a %d. %b %H:%M:%S %z %Y
+date_fmt       "<U0025><U0061><U0020><U0025><U0064><U002E><U0020><U0025>/
+<U0062><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U007A><U0020><U0025><U0059>"
+
 week    7;19971201;4
 first_weekday 1
 first_workday 1

Modified: fsf/trunk/libc/misc/bits/error.h
==============================================================================
--- fsf/trunk/libc/misc/bits/error.h (original)
+++ fsf/trunk/libc/misc/bits/error.h Mon Oct  8 00:04:48 2007
@@ -23,11 +23,11 @@
 
 
 extern void __REDIRECT (__error_alias, (int __status, int __errnum,
-					const char *__format, ...),
+					__const char *__format, ...),
 			error)
   __attribute__ ((__format__ (__printf__, 3, 4)));
 extern void __REDIRECT (__error_noreturn, (int __status, int __errnum,
-					const char *__format, ...),
+					   __const char *__format, ...),
 			error)
   __attribute__ ((__noreturn__, __format__ (__printf__, 3, 4)));
 
@@ -35,7 +35,7 @@
 /* If we know the function will never return make sure the compiler
    realizes that, too.  */
 __extern_always_inline void
-error (int __status, int __errnum, const char *__format, ...)
+error (int __status, int __errnum, __const char *__format, ...)
 {
   if (__builtin_constant_p (__status) && __status != 0)
     __error_noreturn (__status, __errnum, __format, __va_arg_pack ());
@@ -45,15 +45,16 @@
 
 
 extern void __REDIRECT (__error_at_line_alias, (int __status, int __errnum,
-						const char *__fname,
+						__const char *__fname,
 						unsigned int __line,
-						const char *__format, ...),
+						__const char *__format, ...),
 			error_at_line)
   __attribute__ ((__format__ (__printf__, 5, 6)));
 extern void __REDIRECT (__error_at_line_noreturn, (int __status, int __errnum,
-						   const char *__fname,
+						   __const char *__fname,
 						   unsigned int __line,
-						   const char *__format, ...),
+						   __const char *__format,
+						   ...),
 			error_at_line)
   __attribute__ ((__noreturn__, __format__ (__printf__, 5, 6)));
 
@@ -61,7 +62,8 @@
 /* If we know the function will never return make sure the compiler
    realizes that, too.  */
 __extern_always_inline void
-error_at_line (int __status, int __errnum, const char *__format, ...)
+error_at_line (int __status, int __errnum, __const char *__fname,
+	       unsigned int __line,__const char *__format, ...)
 {
   if (__builtin_constant_p (__status) && __status != 0)
     __error_at_line_noreturn (__status, __errnum, __fname, __line, __format,

Modified: fsf/trunk/libc/misc/error.h
==============================================================================
--- fsf/trunk/libc/misc/error.h (original)
+++ fsf/trunk/libc/misc/error.h Mon Oct  8 00:04:48 2007
@@ -29,11 +29,11 @@
    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
    If STATUS is nonzero, terminate the program with `exit (STATUS)'.  */
 
-extern void error (int __status, int __errnum, const char *__format, ...)
+extern void error (int __status, int __errnum, __const char *__format, ...)
      __attribute__ ((__format__ (__printf__, 3, 4)));
 
-extern void error_at_line (int __status, int __errnum, const char *__fname,
-			   unsigned int __lineno, const char *__format, ...)
+extern void error_at_line (int __status, int __errnum, __const char *__fname,
+			   unsigned int __lineno, __const char *__format, ...)
      __attribute__ ((__format__ (__printf__, 5, 6)));
 
 /* If NULL, error will flush stdout, then print on stderr the program

Modified: fsf/trunk/libc/posix/glob.c
==============================================================================
--- fsf/trunk/libc/posix/glob.c (original)
+++ fsf/trunk/libc/posix/glob.c Mon Oct  8 00:04:48 2007
@@ -454,9 +454,11 @@
 	  dirlen = 0;
 	}
     }
-  else if (filename == pattern)
-    {
-      /* "/pattern".  */
+  else if (filename == pattern
+	   || (filename == pattern + 1 && pattern[0] == '\\'
+	       && (flags & GLOB_NOESCAPE) == 0))
+    {
+      /* "/pattern" or "\\/pattern".  */
       dirname = "/";
       dirlen = 1;
       ++filename;

Modified: fsf/trunk/libc/posix/tst-gnuglob.c
==============================================================================
--- fsf/trunk/libc/posix/tst-gnuglob.c (original)
+++ fsf/trunk/libc/posix/tst-gnuglob.c Mon Oct  8 00:04:48 2007
@@ -1,6 +1,6 @@
 /* Test the GNU extensions in glob which allow the user to provide callbacks
    for the filesystem access functions.
-   Copyright (C) 2001-2002 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2001.
 
@@ -103,6 +103,16 @@
   int level = 1;
   long int idx = 0;
 
+  while (s[0] == '/')
+    {
+      if (s[1] == '\0')
+	{
+	  s = ".";
+	  break;
+	}
+      ++s;
+    }
+
   if (strcmp (s, ".") == 0)
     return 0;
 
@@ -439,6 +449,12 @@
 	"dir2lev1/dir1lev2/.dir",
 	"dir2lev1/dir1lev2/.foo");
 
+  test ("\\/*", GLOB_ALTDIRFUNC,
+	"/dir1lev1",
+	"/dir2lev1",
+	"/file1lev1",
+	"/file2lev1");
+
   globfree (&gl);
 
   return result;

Modified: fsf/trunk/libc/wcsmbs/wchar.h
==============================================================================
--- fsf/trunk/libc/wcsmbs/wchar.h (original)
+++ fsf/trunk/libc/wcsmbs/wchar.h Mon Oct  8 00:04:48 2007
@@ -134,7 +134,7 @@
 __USING_NAMESPACE_STD(tm)
 
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Copy SRC to DEST.  */
 extern wchar_t *wcscpy (wchar_t *__restrict __dest,
 			__const wchar_t *__restrict __src) __THROW;
@@ -157,7 +157,7 @@
 /* Compare N wide-characters of S1 and S2.  */
 extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
      __THROW __attribute_pure__;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #ifdef __USE_GNU
 /* Compare S1 and S2, ignoring case.  */
@@ -178,7 +178,7 @@
 			  size_t __n, __locale_t __loc) __THROW;
 #endif
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Compare S1 and S2, both interpreted as appropriate to the
    LC_COLLATE category of the current locale.  */
 extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
@@ -187,7 +187,7 @@
    `wcscoll' to the original strings.  */
 extern size_t wcsxfrm (wchar_t *__restrict __s1,
 		       __const wchar_t *__restrict __s2, size_t __n) __THROW;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #ifdef __USE_GNU
 /* Similar to the two functions above but take the information from
@@ -208,14 +208,14 @@
 extern wchar_t *wcsdup (__const wchar_t *__s) __THROW __attribute_malloc__;
 #endif
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Find the first occurrence of WC in WCS.  */
 extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
      __THROW __attribute_pure__;
 /* Find the last occurrence of WC in WCS.  */
 extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
      __THROW __attribute_pure__;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #ifdef __USE_GNU
 /* This function is similar to `wcschr'.  But it returns a pointer to
@@ -224,7 +224,7 @@
      __THROW __attribute_pure__;
 #endif
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Return the length of the initial segmet of WCS which
    consists entirely of wide characters not in REJECT.  */
 extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
@@ -247,7 +247,7 @@
 
 /* Return the number of wide characters in S.  */
 extern size_t wcslen (__const wchar_t *__s) __THROW __attribute_pure__;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #ifdef __USE_XOPEN
 /* Another name for `wcsstr' from XPG4.  */
@@ -262,7 +262,7 @@
 #endif
 
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Search N wide characters of S for C.  */
 extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
      __THROW __attribute_pure__;
@@ -283,7 +283,7 @@
 
 /* Set N wide characters of S to C.  */
 extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #ifdef __USE_GNU
 /* Copy N wide characters of SRC to DEST and return pointer to following
@@ -294,7 +294,7 @@
 #endif
 
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Determine whether C constitutes a valid (one-byte) multibyte
    character.  */
 extern wint_t btowc (int __c) __THROW;
@@ -322,7 +322,7 @@
 			mbstate_t *__restrict __ps) __THROW;
 extern size_t mbrlen (__const char *__restrict __s, size_t __n,
 		      mbstate_t *__restrict __ps) __THROW;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #ifdef __USE_EXTERN_INLINES
 /* Define inline function as optimization.  */
@@ -349,7 +349,7 @@
 	  ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); }
 #endif
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Write wide character representation of multibyte character string
    SRC to DST.  */
 extern size_t mbsrtowcs (wchar_t *__restrict __dst,
@@ -361,7 +361,7 @@
 extern size_t wcsrtombs (char *__restrict __dst,
 			 __const wchar_t **__restrict __src, size_t __len,
 			 mbstate_t *__restrict __ps) __THROW;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 
 #ifdef	__USE_GNU
@@ -391,21 +391,25 @@
 #endif	/* Use X/Open.  */
 
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Convert initial portion of the wide string NPTR to `double'
    representation.  */
 extern double wcstod (__const wchar_t *__restrict __nptr,
 		      wchar_t **__restrict __endptr) __THROW;
+__END_NAMESPACE_STD
 
 #ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
 /* Likewise for `float' and `long double' sizes of floating-point numbers.  */
 extern float wcstof (__const wchar_t *__restrict __nptr,
 		     wchar_t **__restrict __endptr) __THROW;
 extern long double wcstold (__const wchar_t *__restrict __nptr,
 			    wchar_t **__restrict __endptr) __THROW;
+__END_NAMESPACE_C99
 #endif /* C99 */
 
 
+__BEGIN_NAMESPACE_STD
 /* Convert initial portion of wide string NPTR to `long int'
    representation.  */
 extern long int wcstol (__const wchar_t *__restrict __nptr,
@@ -416,8 +420,10 @@
 extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
 				  wchar_t **__restrict __endptr, int __base)
      __THROW;
+__END_NAMESPACE_STD
 
 #if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU)
+__BEGIN_NAMESPACE_C99
 /* Convert initial portion of wide string NPTR to `long long int'
    representation.  */
 __extension__
@@ -431,8 +437,8 @@
 extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
 					wchar_t **__restrict __endptr,
 					int __base) __THROW;
+__END_NAMESPACE_C99
 #endif /* ISO C99 or GCC and GNU.  */
-__END_NAMESPACE_C99
 
 #if defined __GNUC__ && defined __USE_GNU
 /* Convert initial portion of wide string NPTR to `long long int'
@@ -522,7 +528,7 @@
 #endif
 
 #if defined __USE_ISOC95 || defined __USE_UNIX98
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 
 /* Select orientation for stream.  */
 extern int fwide (__FILE *__fp, int __mode) __THROW;
@@ -618,7 +624,7 @@
 #  endif
 # endif
 
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 #endif /* Use ISO C95, C99 and Unix98. */
 
 #ifdef __USE_ISOC99
@@ -678,7 +684,7 @@
 #endif /* Use ISO C99. */
 
 
-__BEGIN_NAMESPACE_C99
+__BEGIN_NAMESPACE_STD
 /* Read a character from STREAM.
 
    These functions are possible cancellation points and therefore not
@@ -728,7 +734,7 @@
    This function is a possible cancellation points and therefore not
    marked with __THROW.  */
 extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 
 #ifdef __USE_GNU