Re: [PATCH] eval: Always set exitstatus in evaltree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/12/2022 08:49, Herbert Xu wrote:
There is no harm in setting exitstatus unconditionally in evaltree.

There is a long-standing bug that may or may not be harder to fix if this patch goes in, depending on how you want to fix it. Here's a script that already fails on current dash.

  f() {
    if ! return 0
    then :
    fi
  }
  f

This should return 0, and does return 0 in bash and ksh (and almost all shells), but returns 1 in dash.

There are a few possible ways of fixing it. Some of them rely on continuing to conditionally set exitstatus.

Cheers,
Harald van Dijk



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux