[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: ash: braceless function definiton
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-09-24 21:36:21
Message-ID: 201009242336.21630.vda.linux () googlemail ! com
[Download RAW message or body]

On Friday 24 September 2010 21:21, Mikhail Gusarov wrote:
> The following script:
> 
> ----------------------------------------
> #!/bin/sh
> 
> foo()
> exit 1
> ----------------------------------------
> 
> exits with code 0,

..."when run under ash from busybox version X.Y.Z with the attached .config",
right?

> as lines 3-4 define function foo, despite missing 
> braces around 'exit 1'. Is is proper behaviour? SUSv3 grammar requires
> compound statement as a body of function.
> 
> For the record: zsh and dash behave as ash, bash gives syntax error.

hush also gives syntax error.

This bug does not seem to be worth fixing.
-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic