Skip to content

Commit

Permalink
Fix regression with /i caused by r303047
Browse files Browse the repository at this point in the history
'\n' was specifically added to -e arguments prior to r303047. Restore
historical behavior which in turn fixes usr.sbin/etcupdate/preworld_test:main .

The fix is being committed to address the issue in the short term and may be
iterated upon as noted in bug 211399

Discussed with:		mi, pfg
Differential Revision:	https://reviews.freebsd.org/D7368
PR:			195929, 211399 [*]
MFC after:		18 days
X-MFC with:		r303047
Reported by:		Jenkins
Sponsored by:		EMC / Isilon Storage Division
  • Loading branch information
ngie-eign committed Jul 31, 2016
1 parent 9cdfe23 commit eb38722
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usr.bin/sed/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static void usage(void);
int
main(int argc, char *argv[])
{
char *temp_arg;
int c, fflag;

(void) setlocale(LC_ALL, "");
Expand All @@ -145,7 +146,10 @@ main(int argc, char *argv[])
break;
case 'e':
eflag = 1;
add_compunit(CU_STRING, optarg);
asprintf(&temp_arg, "%s\n", optarg);
if (temp_arg == NULL)
errx(1, "Couldn't allocate temporary buffer");
add_compunit(CU_STRING, temp_arg);
break;
case 'f':
fflag = 1;
Expand Down

0 comments on commit eb38722

Please sign in to comment.