From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Refactor commands/search.c
Date: Tue, 7 Jul 2009 20:42:52 +0200 [thread overview]
Message-ID: <20090707184252.GC14645@thorin> (raw)
In-Reply-To: <20090706211303.23809.9322.stgit@mj.roinet.com>
On Mon, Jul 06, 2009 at 05:13:03PM -0400, Pavel Roskin wrote:
> ChangeLog:
>
> * commands/search.c (search_file): Merge into ...
> (search_fs): ... this. On error, don't output what we were
> looking for. Accept search type as argument.
> (grub_cmd_search): Pass search type to search_fs().
Very nice work. I've been wanting to do this for a while...
> + if (type == SEARCH_FILE)
> + {
> + grub_size_t len;
> + char *p;
> + grub_file_t file;
> +
> + len = grub_strlen (name) + 2 + grub_strlen (key) + 1;
> + p = grub_realloc (buf, len);
> + if (! p)
> + return 1;
> +
> + buf = p;
> + grub_sprintf (buf, "(%s)%s", name, key);
> +
> + file = grub_file_open (buf);
> + if (file)
> + {
> + found = 1;
> + grub_file_close (file);
> + }
> + }
> + else
> + {
I'd suggest making this clearer by eithe explicitly checking for
SEARCH_XXX or otherwise put a comment after the else.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
next prev parent reply other threads:[~2009-07-07 18:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 21:13 [PATCH] Refactor commands/search.c Pavel Roskin
2009-07-07 1:03 ` Arthur Marsh
2009-07-07 1:46 ` Arthur Marsh
2009-07-07 2:13 ` Pavel Roskin
2009-07-07 3:00 ` Arthur Marsh
2009-07-07 18:42 ` Robert Millan [this message]
2009-07-07 20:14 ` Pavel Roskin
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=20090707184252.GC14645@thorin \
--to=rmh@aybabtu.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.