diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-06 00:55:39 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-06 00:55:39 +0000 |
commit | 678fec509dde47fe561de515df7e600274c38380 (patch) | |
tree | 63883ad3aa75d8e957ab2e359e6f5236c78dd505 | |
parent | c383e5c8ac5dd20b1c688cf3ef4d43a8be5483c9 (diff) | |
download | src-678fec509dde47fe561de515df7e600274c38380.tar.gz src-678fec509dde47fe561de515df7e600274c38380.zip |
Fix sed functions 'i' and 'a' from discarding leading white space.
This appears to be implementation dependent but convenient and makes
our sed behave more like GNU sed.
Given that it is not the historic behavior, bump FreeBSD_version
should userland/ports somehow depend on it.
Obtained from: NetBSD (bin/49872)
Reviewed by: bdrewery
PR: 208554
Merge after: NEVER
Notes
Notes:
svn path=/head/; revision=297602
-rw-r--r-- | sys/sys/param.h | 2 | ||||
-rw-r--r-- | usr.bin/sed/compile.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sys/sys/param.h b/sys/sys/param.h index 987453c418a6..2f6eb7af1f76 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100104 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100105 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 68cbbc54f22b..2d7f8d2f6e73 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -730,7 +730,7 @@ compile_tr(char *p, struct s_tr **py) } /* - * Compile the text following an a or i command. + * Compile the text following an a, c, or i command. */ static char * compile_text(void) @@ -746,7 +746,6 @@ compile_text(void) while (cu_fgets(lbuf, sizeof(lbuf), NULL)) { op = s = text + size; p = lbuf; - EATSPACE(); for (esc_nl = 0; *p != '\0'; p++) { if (*p == '\\' && p[1] != '\0' && *++p == '\n') esc_nl = 1; |