diff options
author | pfg <pfg@FreeBSD.org> | 2016-05-10 02:02:50 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-05-10 02:02:50 +0000 |
commit | babb403232a4867456987d37f0415286c2195def (patch) | |
tree | 77147af5211036f65f74b9dee5fc80c966853dff /usr.bin/sed | |
parent | 214f3b8bf1669c26162fb1f48f3321812c59a24a (diff) | |
download | FreeBSD-src-babb403232a4867456987d37f0415286c2195def.zip FreeBSD-src-babb403232a4867456987d37f0415286c2195def.tar.gz |
Revert r299279:
Simplify redundant malloc'ing in sed -e.
It is causing havoc in the ports tree:
===> Configuring for wxsvg-1.5.7
sed: 1: "/gcc_dir=\\`/s/gcc /$CC /": bad flag in substitute command: '/'
*** Error code 1
===> Patching for vips-8.3.1
sed: 1: "1s|^#![[:space:]]*/usr/ ...": bad flag in substitute command: 's'
*** Error code 1
PR: 195929
Reported by: danilo
Diffstat (limited to 'usr.bin/sed')
-rw-r--r-- | usr.bin/sed/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index a5ff462..36a3299 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -125,6 +125,7 @@ int main(int argc, char *argv[]) { int c, fflag; + char *temp_arg; (void) setlocale(LC_ALL, ""); @@ -146,7 +147,11 @@ main(int argc, char *argv[]) break; case 'e': eflag = 1; - add_compunit(CU_STRING, optarg); + if ((temp_arg = malloc(strlen(optarg) + 2)) == NULL) + err(1, "malloc"); + strcpy(temp_arg, optarg); + strcat(temp_arg, "\n"); + add_compunit(CU_STRING, temp_arg); break; case 'f': fflag = 1; |