From: Paul Eggert Date: Sun, 7 Jul 2013 00:12:29 +0000 (-0700) Subject: fnmatch: don't goto over declaration X-Git-Tag: stable/20130805~6 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=9e801adc214e131c6ea4c667407f54aa62888913 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 . (cherry picked from commit c96bab3fee48a9df55e7366344f838e1fc785c28) --- diff --git a/ChangeLog b/ChangeLog index 6235a46f6..21eedcdfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-07-06 Paul Eggert + + 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 + . + 2013-07-03 Eric Blake mgetgroups: relax license to LGPLv2+ diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c index 1953302aa..c303de2a1 100644 --- a/lib/fnmatch_loop.c +++ b/lib/fnmatch_loop.c @@ -227,6 +227,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, c = *p++; for (;;) { + bool is_range = false; + if (!(flags & FNM_NOESCAPE) && c == L_('\\')) { if (*p == L_('\0')) @@ -420,8 +422,6 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, } else { - bool is_range = false; - #ifdef _LIBC bool is_seqval = false;