[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New command eval.
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: New command eval. |
Date: |
Sat, 11 May 2013 19:02:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
On 11.05.2013 18:35, Andrey Borzenkov wrote:
> + grub_size_t size = argc; /* +1 for final zero */
> + char *str, *p;
> + grub_err_t ret;
> +
> + if (argc == 0)
> + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing arguments"));
> +
eval with no arguments returns success in bash, to match this behaviour,
it should be GRUB_ERR_NONE and no use of grub_error
> + for (i = 0; i < argc; i++)
> + size += grub_strlen (argv[i]);
> +
> + str = p = grub_malloc (size);
> + if (!str)
> + return grub_errno;
> +
> + for (i = 0; i < argc; i++)
> + {
> + grub_strcpy (p, argv[i]);
> + p += grub_strlen (argv[i]);
These 2 operations should be condensed by using grub_stpcpy
> + *p++ = ' ';
>- grub_script_execute_sourcecode (script, 0, dummy);
>+ grub_script_execute_sourcecode (script);
(in menu_entry.c) here you need a new scope for consistency.
signature.asc
Description: OpenPGP digital signature
- Re: Obtaining the MAC address of the boot NIC for a PXE boot, Andrey Borzenkov, 2013/05/01
- Re: Obtaining the MAC address of the boot NIC for a PXE boot, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/05/04
- Re: Obtaining the MAC address of the boot NIC for a PXE boot, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/05/04
- Re: Obtaining the MAC address of the boot NIC for a PXE boot, Andrey Borzenkov, 2013/05/05
- Re: Obtaining the MAC address of the boot NIC for a PXE boot, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/05/07
- Documentation for (Re: Obtaining the MAC address of the boot NIC for a PXE boot), Andrey Borzenkov, 2013/05/07
- Re: Documentation for (Re: Obtaining the MAC address of the boot NIC for a PXE boot), Vladimir 'φ-coder/phcoder' Serbinenko, 2013/05/07
- Re: Documentation for (Re: Obtaining the MAC address of the boot NIC for a PXE boot), Andrey Borzenkov, 2013/05/08
New command eval., Andrey Borzenkov, 2013/05/11
Re: New command eval., Seth Goldberg, 2013/05/11
Re: New command eval., Andrey Borzenkov, 2013/05/12
Re: New command eval., Seth Goldberg, 2013/05/13
Re: New command eval., Vladimir 'φ-coder/phcoder' Serbinenko, 2013/05/14
Re: Obtaining the MAC address of the boot NIC for a PXE boot, Rigoberto Corujo, 2013/05/08