|
From: Rocky B. <roc...@gm...> - 2008-08-04 12:14:30
|
Thanks. It is great to have someone else looking over the code.
As usual, you are correct. I've also updated the unit test in
test/unit/test-set0.sh.in so it would have caught at least one of the
flaws.
On Mon, Aug 4, 2008 at 7:34 AM, Masatake YAMATO <ya...@re...> wrote:
> Hi,
>
> (I lost je...@gy....
> Please use ya...@re... to contact with me about FOSS.)
>
> I have a chance to read set0.
> I have not had time to build it. However, I could find some lines
> which will cause troubles. Could you review following patch?
>
>
> 2008-08-04 Masatake YAMATO <ya...@re...>
>
> * builtin/set0.c: Fix comments.
> (set0_builtin): Free $0 before overwriting.
> Return SUCCESS instead of FAILURE.
>
> Index: set0.c
> ===================================================================
> RCS file: /cvsroot/bashdb/bash-3.1/builtin/set0.c,v
> retrieving revision 1.1
> diff -c -r1.1 set0.c
> *** set0.c 23 May 2008 23:55:25 -0000 1.1
> --- set0.c 4 Aug 2008 11:30:01 -0000
> ***************
> *** 1,5 ****
> /*
> ! Extends bash with a builtin function to test if a name is defined or not.
>
> To install after compiling:
> cd *this directory*
> --- 1,5 ----
> /*
> ! Set $0.
>
> To install after compiling:
> cd *this directory*
> ***************
> *** 31,38 ****
> return (EX_USAGE);
> }
>
> dollar_vars[0] = savestring(list->word->word);
> ! return EXECUTION_FAILURE;
> }
>
> struct builtin set0_struct = {
> --- 31,41 ----
> return (EX_USAGE);
> }
>
> + if (dollar_vars[0])
> + free (dollar_vars[0]);
> +
> dollar_vars[0] = savestring(list->word->word);
> ! return EXECUTION_SUCCESS;
> }
>
> struct builtin set0_struct = {
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bashdb-devel mailing list
> Bas...@li...
> https://lists.sourceforge.net/lists/listinfo/bashdb-devel
>
|