summaryrefslogtreecommitdiff
path: root/sed
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2006-08-21 17:32:22 +0000
committerPaolo Bonzini <bonzini@gnu.org>2008-01-09 16:12:12 +0100
commit0177318fa612307ce2e7eb7557e54d335ffd08f3 (patch)
treec60484e4a70a2b5ec70dc6cb08dcb7b3eea6b932 /sed
parentb8eb0a13d4c3031d33220da3c6a855d5dc8446d1 (diff)
downloadsed-0177318fa612307ce2e7eb7557e54d335ffd08f3.tar.gz
accept NUL for `.'
2006-08-21 Paolo Bonzini <bonzini@gnu.org> * sed/regexp.c: Accept NUL bytes for `.'. Accept 'a\(b' in POSIXLY_CORRECT/POSIXLY_BASIC posixicity. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-73
Diffstat (limited to 'sed')
-rw-r--r--sed/regexp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sed/regexp.c b/sed/regexp.c
index d4e7437..1297c5e 100644
--- a/sed/regexp.c
+++ b/sed/regexp.c
@@ -1,5 +1,6 @@
/* GNU SED, a batch stream editor.
- Copyright (C) 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,7 +65,12 @@ compile_regex_1 (new_regex, needed_sub)
int syntax = ((extended_regexp_flags & REG_EXTENDED)
? RE_SYNTAX_POSIX_EXTENDED
: RE_SYNTAX_POSIX_BASIC)
- & ~RE_UNMATCHED_RIGHT_PAREN_ORD;
+ & ~RE_DOT_NOT_NULL;
+
+ if (posixicity == POSIXLY_EXTENDED)
+ syntax &= ~RE_UNMATCHED_RIGHT_PAREN_ORD;
+ else
+ syntax |= RE_UNMATCHED_RIGHT_PAREN_ORD;
syntax |= RE_NO_POSIX_BACKTRACKING;
#ifdef RE_ICASE