Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2000 10:50:08 -0700 (PDT)
From:      Nick Sayer <nsayer@sftw.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/18474: sed i\ does not append newline
Message-ID:  <200005101750.KAA86594@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/18474; it has been noted by GNATS.

From: Nick Sayer <nsayer@sftw.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/18474: sed i\ does not append newline
Date: Wed, 10 May 2000 10:45:55 -0700 (PDT)

 The patch above breaks sed -f. Instead, this patch explicitely
 appends a \n to -e arguments.
 
 --- main.c.orig	Wed May 10 10:31:02 2000
 +++ main.c	Wed May 10 10:33:36 2000
 @@ -114,6 +114,7 @@
  	char *argv[];
  {
  	int c, fflag;
 +	char *temp_arg;
  
  	(void) setlocale(LC_ALL, "");
  
 @@ -125,7 +126,10 @@
  			break;
  		case 'e':
  			eflag = 1;
 -			add_compunit(CU_STRING, optarg);
 +			temp_arg=malloc(strlen(optarg)+2);
 +			strcpy(temp_arg,optarg);
 +			strcat(temp_arg,"\n");
 +			add_compunit(CU_STRING, temp_arg);
  			break;
  		case 'f':
  			fflag = 1;
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005101750.KAA86594>