summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authornsayer <nsayer@FreeBSD.org>2000-05-11 17:01:52 +0000
committernsayer <nsayer@FreeBSD.org>2000-05-11 17:01:52 +0000
commit277ddd560dc9f17d901629990ad4f78e8569b258 (patch)
tree4e46da14658823e72d52e73a140fa02284548af9 /usr.bin/sed
parentc4413949b9a6ad28a99060b41b8f7a42b0f5e742 (diff)
downloadFreeBSD-src-277ddd560dc9f17d901629990ad4f78e8569b258.zip
FreeBSD-src-277ddd560dc9f17d901629990ad4f78e8569b258.tar.gz
Fix compatibility issue in sed. Do so by explicitely adding a
newline to the end of any -e argument. PR: bin/18474
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 1c5e885..5c67882 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -115,6 +115,7 @@ main(argc, argv)
char *argv[];
{
int c, fflag;
+ char *temp_arg;
(void) setlocale(LC_ALL, "");
@@ -129,7 +130,10 @@ main(argc, argv)
break;
case 'e':
eflag = 1;
- add_compunit(CU_STRING, optarg);
+ temp_arg=xmalloc(strlen(optarg) + 2);
+ strcpy(temp_arg, optarg);
+ strcat(temp_arg, "\n");
+ add_compunit(CU_STRING, temp_arg);
break;
case 'f':
fflag = 1;
OpenPOWER on IntegriCloud