]> granicus.if.org Git - php/commitdiff
Fix [-Wjump-misses-init] in php_mbregex.c by adding an inner scope
authorGeorge Peter Banyard <girgias@php.net>
Tue, 14 Apr 2020 23:22:10 +0000 (01:22 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Sat, 18 Apr 2020 12:52:48 +0000 (14:52 +0200)
ext/mbstring/php_mbregex.c

index cbbe3532f0aede33729a38c425a9f448f90b9b69..43855545d732298f24312d666b27ca5a6ea2e5b2 100644 (file)
@@ -768,6 +768,7 @@ static inline void mb_regex_substitute(
                                p++;
                                break;
                        case 'k':
+                       {
                                clen = (int) php_mb_mbchar_bytes_ex(++p, enc);
                                if (clen != 1 || p == eos || (p[0] != '<' && p[0] != '\'')) {
                                        /* not a backref delimiter */
@@ -817,6 +818,7 @@ static inline void mb_regex_substitute(
                                }
                                no = onig_name_to_backref_number(regexp, (OnigUChar *)name, (OnigUChar *)name_end, regs);
                                break;
+                       }
                        default:
                                /* We're not treating \ as an escape character and will interpret something like
                                 * \\1 as \ followed by \1, rather than \\ followed by 1. This is because this