Author: dds
Date: Sun Sep 20 15:47:31 2009
New Revision: 197362
URL: http://svn.freebsd.org/changeset/base/197362

Log:
  IEEE Std 1003.1, 2004 Edition states:
  
  "The escape sequence '\n' shall match a <newline> embedded in
  the pattern space."
  
  It is unclear whether this also applies to a \n embedded in a
  character class.  Disable the existing handling of \n in a character
  class following Mac OS X, GNU sed version 4.1.5 with --posix, and
  SunOS 5.10 /usr/bin/sed.
  
  Pointed by:   Marius Strobl
  Obtained from:        Mac OS X

Added:
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.22   (contents, 
props changed)
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.23   (contents, 
props changed)
Modified:
  head/tools/regression/usr.bin/sed/multitest.t
  head/usr.bin/sed/compile.c

Modified: head/tools/regression/usr.bin/sed/multitest.t
==============================================================================
--- head/tools/regression/usr.bin/sed/multitest.t       Sun Sep 20 15:17:40 
2009        (r197361)
+++ head/tools/regression/usr.bin/sed/multitest.t       Sun Sep 20 15:47:31 
2009        (r197362)
@@ -449,6 +449,9 @@ u2/g' lines1
        mark '8.21'
        echo 'a\b(c' |
        $SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, 
/\\()"%abcdefghijklmnopqrstuvwxyz,------%'
+       COMMENT='\n in a character class and a BRE'
+       mark '8.22' ; (echo 1; echo 2) | $SED -n '1{;N;s/[\n]/X/;p;}'
+       mark '8.23' ; (echo 1; echo 2) | $SED -n '1{;N;s/\n/X/;p;}'
 }
 
 test_error()

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.22
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.22        Sun Sep 
20 15:47:31 2009        (r197362)
@@ -0,0 +1,2 @@
+1
+2

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.23
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.23        Sun Sep 
20 15:47:31 2009        (r197362)
@@ -0,0 +1 @@
+1X2

Modified: head/usr.bin/sed/compile.c
==============================================================================
--- head/usr.bin/sed/compile.c  Sun Sep 20 15:17:40 2009        (r197361)
+++ head/usr.bin/sed/compile.c  Sun Sep 20 15:47:31 2009        (r197362)
@@ -432,8 +432,7 @@ compile_ccl(char **sp, char *t)
                        for (c = *s; (*t = *s) != ']' || c != d; s++, t++)
                                if ((c = *s) == '\0')
                                        return NULL;
-               } else if (*s == '\\' && s[1] == 'n')
-                           *t = '\n', s++;
+               }
        return (*s == ']') ? *sp = ++s, ++t : NULL;
 }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to