]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Clear the RE_NO_EMPTY_RANGES re syntax option, as this is a less intrusive
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 12 Apr 2006 07:37:11 +0000 (07:37 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 12 Apr 2006 07:37:11 +0000 (07:37 +0000)
change from the old (Emacs) behavior, and POSIX allows us to treat [z-a]
as an empty range.

src/csplit.c
src/expr.c
src/nl.c

index 4544a3ed109492372f67ff45a5c95ec1d5de8a8a..3fdc3f061f1d4ae464ddd1db09578bdbee8565b5 100644 (file)
@@ -1121,7 +1121,8 @@ extract_regexp (int argnum, bool ignore, char const *str)
   p->re_compiled.allocated = 0;
   p->re_compiled.fastmap = p->fastmap;
   p->re_compiled.translate = NULL;
-  re_syntax_options = RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP;
+  re_syntax_options =
+    RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP & ~RE_NO_EMPTY_RANGES;
   err = re_compile_pattern (str + 1, len, &p->re_compiled);
   if (err)
     {
index 0e2549f00549eaf676a289d4538966c2af8c009a..c5b1ae87bf3bac0a9039448af947d02ce185efde 100644 (file)
@@ -424,7 +424,8 @@ docolon (VALUE *sv, VALUE *pv)
   re_buffer.allocated = 0;
   re_buffer.fastmap = fastmap;
   re_buffer.translate = NULL;
-  re_syntax_options = RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP;
+  re_syntax_options =
+    RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP & ~RE_NO_EMPTY_RANGES;
   errmsg = re_compile_pattern (pv->u.s, strlen (pv->u.s), &re_buffer);
   if (errmsg)
     error (EXPR_INVALID, 0, "%s", errmsg);
index 7aad2e8f2467d5b5c917ef189d6f91fe8ce4bc37..7ee57b77d60e20901b9f4f6cf358427dc1a3a3b2 100644 (file)
--- a/src/nl.c
+++ b/src/nl.c
@@ -253,7 +253,8 @@ build_type_arg (char **typep, struct re_pattern_buffer *regexp, char *fastmap)
       regexp->allocated = 0;
       regexp->fastmap = fastmap;
       regexp->translate = NULL;
-      re_syntax_options = RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP;
+      re_syntax_options =
+       RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP & ~RE_NO_EMPTY_RANGES;
       errmsg = re_compile_pattern (optarg, strlen (optarg), regexp);
       if (errmsg)
        error (EXIT_FAILURE, 0, "%s", errmsg);