dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] expand: Fix trailing newlines processing in backquote expanding
       [not found] <20190429141337.6804-1-n.merinov@inango-systems.com>
@ 2020-01-13 12:08 ` Nikolai Merinov
  2020-01-15  6:00   ` Herbert Xu
  2020-01-20  9:56 ` Herbert Xu
  1 sibling, 1 reply; 3+ messages in thread
From: Nikolai Merinov @ 2020-01-13 12:08 UTC (permalink / raw)
  To: dash, herbert; +Cc: os

Hi Herbert,

Do you want any changes to this patch from us? This patch in state "Under Review" more then 8 months.

Regards,
Nikolai

----- Original Message -----
> From: "n merinov" <n.merinov@inango-systems.com>
> To: dash@vger.kernel.org
> Cc: "os" <os@inango-systems.com>, "n merinov" <n.merinov@inango-systems.com>
> Sent: Monday, April 29, 2019 7:13:37 PM
> Subject: [PATCH] expand: Fix trailing newlines processing in backquote expanding

> According to POSIX.1-2008 we should remove newlines only at the end of
> the substitution. Newlines-only substitions causes dash to remove
> newlines before beggining of the substitution. The following code:
> 
>    cat <<END
>    1
>    $(echo "")
>    2
>    END
> 
> prints "1<newline>2" instead of expected "1<newline><newline>2".
> 
> This patch fixes trailing newlines processing in backquote expanding.
> 
> Signed-off-by: Nikolai Merinov <n.merinov@inango-systems.com>
> ---
> src/expand.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/expand.c b/src/expand.c
> index af9cac9..1b1f95e 100644
> --- a/src/expand.c
> +++ b/src/expand.c
> @@ -525,7 +525,7 @@ read:
> 
> 	/* Eat all trailing newlines */
> 	dest = expdest;
> -	for (; dest > (char *)stackblock() && dest[-1] == '\n';)
> +	for (; dest > ((char *)stackblock() + startloc) && dest[-1] == '\n';)
> 		STUNPUTC(dest);
> 	expdest = dest;
> 
> --
> 2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] expand: Fix trailing newlines processing in backquote expanding
  2020-01-13 12:08 ` [PATCH] expand: Fix trailing newlines processing in backquote expanding Nikolai Merinov
@ 2020-01-15  6:00   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2020-01-15  6:00 UTC (permalink / raw)
  To: Nikolai Merinov; +Cc: dash, os

On Mon, Jan 13, 2020 at 02:08:05PM +0200, Nikolai Merinov wrote:
> Hi Herbert,
> 
> Do you want any changes to this patch from us? This patch in state "Under Review" more then 8 months.

Sorry I just had no time to work on dash patches.  I'll try to
work on the backlog fairly soon.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] expand: Fix trailing newlines processing in backquote expanding
       [not found] <20190429141337.6804-1-n.merinov@inango-systems.com>
  2020-01-13 12:08 ` [PATCH] expand: Fix trailing newlines processing in backquote expanding Nikolai Merinov
@ 2020-01-20  9:56 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2020-01-20  9:56 UTC (permalink / raw)
  To: Nikolai Merinov; +Cc: dash, os

On Mon, Apr 29, 2019 at 07:13:37PM +0500, Nikolai Merinov wrote:
> According to POSIX.1-2008 we should remove newlines only at the end of
> the substitution. Newlines-only substitions causes dash to remove
> newlines before beggining of the substitution. The following code:
> 
>     cat <<END
>     1
>     $(echo "")
>     2
>     END
> 
> prints "1<newline>2" instead of expected "1<newline><newline>2".
> 
> This patch fixes trailing newlines processing in backquote expanding.
> 
> Signed-off-by: Nikolai Merinov <n.merinov@inango-systems.com>
> ---
>  src/expand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-20  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190429141337.6804-1-n.merinov@inango-systems.com>
2020-01-13 12:08 ` [PATCH] expand: Fix trailing newlines processing in backquote expanding Nikolai Merinov
2020-01-15  6:00   ` Herbert Xu
2020-01-20  9:56 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).