Re: parser: Do not push token back before parseheredoc

2018-11-20 Thread Simon Ser
On Monday, November 19, 2018 11:43 AM, Herbert Xu  
wrote:
> Sorry for the repost, I'm trying to get this into patchwork.
>
> ---8<---
> When we read the first token in list() we use peektoken instead
> of readtoken as the following code needs to use the same token
> again.  However, this is wrong when we're in a here-document as
> it will clobber the saved token without resetting the tokpushback
> flag.
>
> This patch fixes it by doing the tokpushback after parseheredoc
> and setting lasttoken again if parseheredoc was called.
>
> Reported-by: Ron Yorston 
> Fixes: 7c245aa8ed33 ("[PARSER] Simplify EOF/newline handling in...")
> Fixes: ee5cbe9fd6bc ("[SHELL] Optimize dash -c "command" to avoid a fork")
> Signed-off-by: Herbert Xu 

This works for me.

Tested-by: Simon Ser 

Thanks!


Re: Command substitution in here-documents

2018-08-13 Thread Simon Ser
Hi,

Thanks both for your replies.

On August 13, 2018 4:22 PM, Martijn Dekker  wrote:
> -   The latest release is 0.5.10.2. I can't reproduce the bug at all in
> 0.5.10, 0.5.10.1 or 0.5.10.2.

This is interesting. I can reproduce with the latest commit in master.

> -   I can only reproduce the bug on dash 0.5.9 and 0.5.9.1 in interactive
> mode, inputting the commands manually. I cannot reproduce it when
> running a script (including a dot script sourced using a '.' command in
> interactive mode).

Yeah, I can confirm this only happens in interactive mode.



Command substitution in here-documents

2018-08-10 Thread Simon Ser
Hi all,

I'm trying to use command substitution in here-documents. Here's my script:

  cat < : not found

According to the spec:

> If no part of word is quoted, all lines of the here-document shall be
> expanded for parameter expansion, command substitution, and arithmetic
> expansion.

So I think it should work. It does work in bash fwiw.

Thoughts?

Thanks,
---
Simon Ser
https://emersion.fr