diff options
author | pfg <pfg@FreeBSD.org> | 2016-11-09 18:00:50 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-11-09 18:00:50 +0000 |
commit | ae76dae508b95eb0ab4a3b9bd65333a903686046 (patch) | |
tree | 6c733174b154d914cb0224e342176c71c57e8f0a /usr.bin | |
parent | 755f2814f495aab6798d1018750bbd70430fff17 (diff) | |
download | FreeBSD-src-ae76dae508b95eb0ab4a3b9bd65333a903686046.zip FreeBSD-src-ae76dae508b95eb0ab4a3b9bd65333a903686046.tar.gz |
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
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sed/compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index b5bc3e2..3e79097 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -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; |