diff lib/fnmatch_loop.c @ 17444:a83ad7365d40

fnmatch: don't goto over declaration * lib/fnmatch_loop.c (FCT): Hoist local up one level, to avoid undefined behavior for goto over a declaration. Problem reported by Charlie Brown in <http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00009.html>.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 06 Jul 2013 17:12:29 -0700
parents e542fd46ad6f
children
line wrap: on
line diff
--- a/lib/fnmatch_loop.c
+++ b/lib/fnmatch_loop.c
@@ -227,6 +227,8 @@
             c = *p++;
             for (;;)
               {
+		bool is_range = false;
+
                 if (!(flags & FNM_NOESCAPE) && c == L_('\\'))
                   {
                     if (*p == L_('\0'))
@@ -420,8 +422,6 @@
                   }
                 else
                   {
-                    bool is_range = false;
-
 #ifdef _LIBC
                     bool is_seqval = false;