Fix regression with /i caused by r303047

'\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
This commit is contained in:
Enji Cooper 2016-07-31 05:31:09 +00:00
parent 5467ab90aa
commit 637a1a7446

View File

@ -123,6 +123,7 @@ static void usage(void);
int
main(int argc, char *argv[])
{
char *temp_arg;
int c, fflag;
(void) setlocale(LC_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;