Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
Re: sed: check length before append in substitute
To:
Mohamed Akram <mohd.akram@outlook.com>
Cc:
"tech@openbsd.org" <tech@openbsd.org>
Date:
Wed, 28 Aug 2024 08:30:32 -0600

Download raw body.

Thread
On Fri, 16 Aug 2024 14:33:29 -0000, Mohamed Akram wrote:

> This resolves the case where the pattern space is empty but does not
> start with a null character, which might occur after using the D
> command. This can be seen in the following sed program, which should
> print its input as-is:
>
> 	printf 'foo\n\n' | sed -e 's/^//p' -e '$!N' -e D

Thanks, I've committed this and added a regress test for it.

 - todd