All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: New command eval.
Date: Sat, 11 May 2013 19:02:58 +0200	[thread overview]
Message-ID: <518E79C2.701@gmail.com> (raw)
In-Reply-To: <20130511203534.52499628@opensuse.site>

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]

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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

  reply	other threads:[~2013-05-11 17:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1367240132.58582.YahooMailNeo@web120204.mail.ne1.yahoo.com>
2013-05-01 14:59 ` Obtaining the MAC address of the boot NIC for a PXE boot Andrey Borzenkov
2013-05-04 21:08   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-04 21:19     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-05  5:17       ` Andrey Borzenkov
2013-05-07 10:03         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-07 17:50           ` Documentation for (Re: Obtaining the MAC address of the boot NIC for a PXE boot) Andrey Borzenkov
2013-05-07 19:45             ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-08 14:52               ` Andrey Borzenkov
2013-05-11 16:35     ` New command eval Andrey Borzenkov
2013-05-11 17:02       ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2013-05-11 17:30         ` Andrey Borzenkov
2013-05-14  6:26           ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-12  0:07       ` Seth Goldberg
2013-05-12  5:39         ` Andrey Borzenkov
2013-05-13  5:13           ` Seth Goldberg
2013-05-14  7:21         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-08 17:27   ` Obtaining the MAC address of the boot NIC for a PXE boot Rigoberto Corujo
2013-05-08 19:25     ` Andrey Borzenkov
2013-05-10 16:12       ` Rigoberto Corujo
2013-05-11  4:47         ` Andrey Borzenkov
2013-05-15 17:09           ` Rigoberto Corujo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518E79C2.701@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.