svn commit: r308472 - stable/11/usr.bin/sed
Pedro F. Giffuni
pfg at FreeBSD.org
Wed Nov 9 18:00:51 UTC 2016
Author: pfg
Date: Wed Nov 9 18:00:50 2016
New Revision: 308472
URL: https://svnweb.freebsd.org/changeset/base/308472
Log:
MFC r308314:
sed(1): add LEGACY_BSDSED_COMPAT compile-time flag.
In r297602, which included a __FreeBSD_version bump to 1100105, we changed
sed 'i' and 'a' from discarding whitespaces to conform with what GNU and
sysvish sed do.
There are arguments in favor of keeping the old behavior but the new
behavior is also useful for migration purposes. It seems important to at
least consider the case of developers depending on the previous behavior
so add a CFLAG to enable the old behavior.
PR: 213474
Modified:
stable/11/usr.bin/sed/compile.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/usr.bin/sed/compile.c
==============================================================================
--- stable/11/usr.bin/sed/compile.c Wed Nov 9 17:57:55 2016 (r308471)
+++ stable/11/usr.bin/sed/compile.c Wed Nov 9 18:00:50 2016 (r308472)
@@ -746,6 +746,9 @@ compile_text(void)
while (cu_fgets(lbuf, sizeof(lbuf), NULL)) {
op = s = text + size;
p = lbuf;
+#ifdef LEGACY_BSDSED_COMPAT
+ EATSPACE();
+#endif
for (esc_nl = 0; *p != '\0'; p++) {
if (*p == '\\' && p[1] != '\0' && *++p == '\n')
esc_nl = 1;
More information about the svn-src-stable
mailing list