Date: Fri, 4 Nov 2016 20:49:59 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308314 - head/usr.bin/sed Message-ID: <201611042049.uA4Knxcx019490@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Nov 4 20:49:59 2016 New Revision: 308314 URL: https://svnweb.freebsd.org/changeset/base/308314 Log: 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 behaviour. PR: 213474 MFC after: 5 days Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Fri Nov 4 20:38:26 2016 (r308313) +++ head/usr.bin/sed/compile.c Fri Nov 4 20:49:59 2016 (r308314) @@ -746,6 +746,9 @@ compile_text(void) while (cu_fgets(lbuf, sizeof(lbuf), NULL) != 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?201611042049.uA4Knxcx019490>