Преглед на файлове

remove some no-op end of string tests from regex parser

these are cruft from the original code which used an explicit string
length rather than null termination. i blindly converted all the
checks to null terminator checks, without noticing that in several
cases, the subsequent switch statement would automatically handle the
null byte correctly.
Rich Felker преди 13 години
родител
ревизия
13b2945a3c
променени са 1 файла, в които са добавени 0 реда и са изтрити 4 реда
  1. 0 4
      src/regex/regcomp.c

+ 0 - 4
src/regex/regcomp.c

@@ -1052,8 +1052,6 @@ tre_parse(tre_parse_ctx_t *ctx)
 	  }
 
 	case PARSE_UNION:
-	  if (!*ctx->re)
-	    break;
 	  switch (*ctx->re)
 	    {
 	    case CHAR_PIPE:
@@ -1086,8 +1084,6 @@ tre_parse(tre_parse_ctx_t *ctx)
 
 	case PARSE_POSTFIX:
 	  /* Parse postfix operators. */
-	  if (!*ctx->re)
-	    break;
 	  switch (*ctx->re)
 	    {
 	    case CHAR_PLUS: