[PATCH] hush.c - export -n flag support

Bayram Kurumahmut bayram.kurumahmut at gmail.com
Tue Apr 21 07:28:19 UTC 2009


I see export -n patch is applied and new test files are added with
enhancements.

Thanks,
Bayram

On Tue, Apr 21, 2009 at 9:55 AM, Bayram Kurumahmut <kbayram at ubicom.com>wrote:

>
> A new patch and updated test files. Tests previously mentioned are applied
> and passed.
>
> bayram at bk-pc:/media/disk-1/busybox-trunk$ bash
> shell/hush_test/hush-misc/export-n.tests
> declare -x aaa1="'''"
> declare -x aaa2=""
> declare -x aaa3="'''abc"
> declare -x aaa8="8"
> aaa9=9
> aaa10=10
> Done
> bayram at bk-pc:/media/disk-1/busybox-trunk$ ./hush
> shell/hush_test/hush-misc/export-n.tests
> export aaa1="'''"
> export aaa2=''
> export aaa3="'''"'abc'
> export aaa8='8'
> aaa9=9
> aaa10=10
> Done
>
> bayram at bk-pc:/media/disk-1/busybox-trunk$ bash -c 'export -n VVV=z; env |
> grep VVV'
> bayram at bk-pc:/media/disk-1/busybox-trunk$ ./hush -c 'export -n VVV=z; env
> | grep VVV'
>
> bayram at bk-pc:/media/disk-1/busybox-trunk$ bash -c 'echo $HOME; echo
> Unexporting; export -n HOME; HOME=z; env | grep HOME'
> /home/bayram
> Unexporting
> bayram at bk-pc:/media/disk-1/busybox-trunk$ ./hush -c 'echo $HOME; echo
> Unexporting; export -n HOME; HOME=z; env | grep HOME'
> /home/bayram
> Unexporting
>
> When I disable '-n' support, the following output still exists. As Mike
> said, there may be provided a common method for option handling.
>
> bayram at bk-pc:/media/disk-1/busybox-trunk$ bash -c 'export -nnnnnnnnn
> nnnnnnnn; env | grep nnnnn'
> bayram at bk-pc:/media/disk-1/busybox-trunk$ ./hush -c 'export -nnnnnnnnn
> nnnnnnnn; env | grep nnnnn'
> -nnnnnnnnn=
> nnnnnnnn=
>
>
> Regards,
> Bayram
>
> -----Original Message-----
> From: busybox-bounces at busybox.net on behalf of Mike Frysinger
> Sent: Mon 20.04.2009 16:06
> To: busybox at busybox.net
> Subject: Re: [PATCH] hush.c - export -n flag support
>
> On Monday 20 April 2009 18:05:09 Denys Vlasenko wrote:
> > On Monday 20 April 2009 21:11, Bayram Kurumahmut wrote:
> > > Added two new files: shell/hush_test/export-n.tests and
> > > shell/hush_test/export-n.right
> > > Added set then export -n test and test cases from my first mail
> > > Config.in help text changed
> >
> > Problems:
> >
> > Did you try to build with HUSH_EXPORT_N off?
> > It still accepts -n even then.
>
> this is unrelated to his code.  not throwing an error with unknown option
> is
> not the same thing as accepting it.  we should add logic that rejects all
> unknown options.  that would result in -n being rejected by common code
> when
> support is turned off.
>
> so, ignoring his patch completely, current code does not throw errors when
> doing things like:
> export -n
> export -Z
> export -askdlfjasklfjasklf
> -mike
>
>
>
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>



-- 
Bayram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090421/b9dba81c/attachment.htm>


More information about the busybox mailing list