Date: Wed, 9 Nov 2016 18:00:50 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308472 - stable/11/usr.bin/sed Message-ID: <201611091800.uA9I0oqB093789@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611091800.uA9I0oqB093789>