Removed REG_NEWLINE from regcomp to fix the same bug found in grep where it

would not match blank lines (bug #1064). Followed Matt Kraii's suit on his
1.42 revision of grep. Tested it, works.
This commit is contained in:
Mark Whitley 2000-11-03 20:23:49 +00:00
parent e7ff2842dd
commit eb69ead091
2 changed files with 2 additions and 2 deletions

View File

@ -222,7 +222,7 @@ static int get_address(const char *str, int *line, regex_t **regex)
fatalError("unterminated match expression\n"); fatalError("unterminated match expression\n");
my_str[idx] = '\0'; my_str[idx] = '\0';
*regex = (regex_t *)xmalloc(sizeof(regex_t)); *regex = (regex_t *)xmalloc(sizeof(regex_t));
xregcomp(*regex, my_str+1, REG_NEWLINE); xregcomp(*regex, my_str+1, 0);
idx++; /* so it points to the next character after the last '/' */ idx++; /* so it points to the next character after the last '/' */
} }
else { else {

2
sed.c
View File

@ -222,7 +222,7 @@ static int get_address(const char *str, int *line, regex_t **regex)
fatalError("unterminated match expression\n"); fatalError("unterminated match expression\n");
my_str[idx] = '\0'; my_str[idx] = '\0';
*regex = (regex_t *)xmalloc(sizeof(regex_t)); *regex = (regex_t *)xmalloc(sizeof(regex_t));
xregcomp(*regex, my_str+1, REG_NEWLINE); xregcomp(*regex, my_str+1, 0);
idx++; /* so it points to the next character after the last '/' */ idx++; /* so it points to the next character after the last '/' */
} }
else { else {