Ver código fonte

test/regex/tst-regex2.c: fix test failure. Next one is immediately after...

 test 2 pattern 0 '.?.?.?.?.?.?.?Log\.13'
-incorrect num_regs 30, expected 2
+ 1.283480s
+test 2 pattern 1 '(.?)(.?)(.?)(.?)(.?)(.?)(.?)Log\.13'
+ 3.429810s
+test 2 pattern 2 '((((((((((.?))))))))))((((((((((.?))))))))))....'
+incorrect num_regs 30, expected 72
Denis Vlasenko 16 anos atrás
pai
commit
cac6ed4e68
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      libc/misc/regex/regex_old.c

+ 1 - 1
libc/misc/regex/regex_old.c

@@ -6099,7 +6099,7 @@ byte_re_match_2_internal (
                 { /* No.  So allocate them with malloc.  We need one
                      extra element beyond `num_regs' for the `-1' marker
                      GNU code uses.  */
-                  regs->num_regs = MAX (RE_NREGS, num_regs + 1);
+                  regs->num_regs = MIN (RE_NREGS, num_regs + 1);
                   regs->start = TALLOC (regs->num_regs, regoff_t);
                   regs->end = TALLOC (regs->num_regs, regoff_t);
                   if (regs->start == NULL || regs->end == NULL)