bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] fnmatch patches merged from glibc


From: Paul Eggert
Subject: [Bug-gnulib] fnmatch patches merged from glibc
Date: 14 Jan 2004 14:16:58 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

I installed this:

2004-01-14  Paul Eggert  <address@hidden>

        Merge fnmatch patches from glibc.
        * fnmatch.c (mbsinit): Remove define.
        Add libc_hidden_ver (__fnmatch, fnmatch).
        * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
        Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.

Index: lib/fnmatch.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/fnmatch.c,v
retrieving revision 1.25
diff -p -u -r1.25 fnmatch.c
--- lib/fnmatch.c       16 Oct 2003 06:51:24 -0000      1.25
+++ lib/fnmatch.c       14 Jan 2004 22:12:51 -0000
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004
+       Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -74,7 +74,6 @@ char *alloca ();
 # include <shlib-compat.h>
 
 # define CONCAT(a,b) __CONCAT(a,b)
-# define mbsinit __mbsinit
 # define mbsrtowcs __mbsrtowcs
 # define fnmatch __fnmatch
 extern int fnmatch (const char *pattern, const char *string, int flags);
@@ -88,7 +87,7 @@ extern int fnmatch (const char *pattern,
 #define NO_LEADING_PERIOD(flags) \
   ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD))
 
-/* Comment out all this code if we are using the GNU C Library, are not
+/* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself, and have not detected a bug
    in the library.  This code is part of the GNU C
    Library, but also included in many other GNU distributions.  Compiling
@@ -398,6 +397,7 @@ versioned_symbol (libc, __fnmatch, fnmat
 strong_alias (__fnmatch, __fnmatch_old)
 compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
 #  endif
+libc_hidden_ver (__fnmatch, fnmatch)
 # endif
 
 #endif /* _LIBC or not __GNU_LIBRARY__.  */
Index: lib/fnmatch_loop.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/fnmatch_loop.c,v
retrieving revision 1.5
diff -p -u -r1.5 fnmatch_loop.c
--- lib/fnmatch_loop.c  16 Oct 2003 06:51:24 -0000      1.5
+++ lib/fnmatch_loop.c  14 Jan 2004 22:12:52 -0000
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004
+       Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -531,11 +531,13 @@ FCT (const CHAR *pattern, const CHAR *st
                                if (! is_range)
                                  {
 # ifdef WIDE_CHAR_VERSION
-                                   for (c1 = 0; c1 < wextra[idx]; ++c1)
+                                   for (c1 = 0;
+                                        (int32_t) c1 < wextra[idx];
+                                        ++c1)
                                      if (n[c1] != wextra[1 + c1])
                                        break;
 
-                                   if (c1 == wextra[idx])
+                                   if ((int32_t) c1 == wextra[idx])
                                      goto matched;
 # else
                                    for (c1 = 0; c1 < extra[idx]; ++c1)
@@ -611,7 +613,7 @@ FCT (const CHAR *pattern, const CHAR *st
 
 # ifdef WIDE_CHAR_VERSION
                        /* Search in the `names' array for the characters.  */
-                       fcollseq = collseq_table_lookup (collseq, fn);
+                       fcollseq = __collseq_table_lookup (collseq, fn);
                        if (fcollseq == ~((uint32_t) 0))
                          /* XXX We don't know anything about the character
                             we are supposed to match.  This means we are
@@ -621,7 +623,7 @@ FCT (const CHAR *pattern, const CHAR *st
                        if (is_seqval)
                          lcollseq = cold;
                        else
-                         lcollseq = collseq_table_lookup (collseq, cold);
+                         lcollseq = __collseq_table_lookup (collseq, cold);
 # else
                        fcollseq = collseq[fn];
                        lcollseq = is_seqval ? cold : collseq[(UCHAR) cold];
@@ -783,7 +785,7 @@ FCT (const CHAR *pattern, const CHAR *st
                              {
 # ifdef WIDE_CHAR_VERSION
                                hcollseq =
-                                 collseq_table_lookup (collseq, cend);
+                                 __collseq_table_lookup (collseq, cend);
                                if (hcollseq == ~((uint32_t) 0))
                                  {
                                    /* Hum, no information about the upper
@@ -924,7 +926,7 @@ FCT (const CHAR *pattern, const CHAR *st
        case L('/'):
          if (NO_LEADING_PERIOD (flags))
            {
-             if (n == string_end || c != *n)
+             if (n == string_end || c != (UCHAR) *n)
                return FNM_NOMATCH;
 
              new_no_leading_period = 1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]