From: Vincent Pelletier <subdino2004@yahoo.fr>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCHv2] dprintf implementation
Date: Fri, 25 Feb 2005 19:04:57 +0100 [thread overview]
Message-ID: <421F68C9.8050504@yahoo.fr> (raw)
In-Reply-To: <200502251812.04315.okuji@enbug.org>
Yoshinori K. Okuji wrote:
> On Friday 25 February 2005 17:02, Hollis Blanchard wrote:
>>int
>>grub_strword (const char *haystack, const char *needle)
>>{
>> int pos = 0;
>> int found = 0;
>>
>> while (haystack[pos]) {
>> /* Advance to next word. */
>> while (grub_iswordseparator (haystack[pos]))
>> pos++;
>>
>> if (0 == grub_strcmp (&haystack[pos], needle))
>> {
>> found = 1;
>> break;
>> }
>> }
>>
>> return found;
>>}
What about grub_strword("all,foo","all") ?
Wouldn't strcmp tell that {'a','l','l',',',...,'\0'} and
{'a','l','l','\0'} are different ?
> grub_strword ("filesystem", "file") returns 0 in your implementation.
Isn't it what should happen ?
If we use 2 similar words, one being a substring of the other, I don't
think the substring should make the larger match too. Or we might add a
hierarchy thing (filesystem/inode, filesystem/block, kern/alloc,
kern/term/font/draw, ...) where "filesystem" would match all
"filesystem/*" ad "filesystem/inode" would only match that one.
Hollis: mmh, I bet you'll say it's overcomplicated :). And I think
you're right. The more I think about such "simple" debug func, the more
I feel like I'll take over the world of debugging system... Well, time
to find some more of those nice mushrooms ;). And a clean paper to write
those 500 Changelog entries.
Vincent Pelletier
next prev parent reply other threads:[~2005-02-25 18:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-21 21:04 [PATCH] dprintf implementation Vincent Pelletier
2005-02-23 23:11 ` Hollis Blanchard
2005-02-24 8:02 ` Vincent Pelletier
2005-02-24 8:49 ` Aki Tossavainen
2005-02-24 19:30 ` Yoshinori K. Okuji
2005-02-24 22:42 ` Vincent Pelletier
2005-02-25 0:18 ` Hollis Blanchard
2005-02-25 7:14 ` Aki Tossavainen
2005-02-25 11:52 ` [PATCHv2] " Vincent Pelletier
2005-02-25 16:02 ` Hollis Blanchard
2005-02-25 16:13 ` Aki Tossavainen
2005-02-25 16:41 ` Hollis Blanchard
2005-02-25 17:12 ` Yoshinori K. Okuji
2005-02-25 18:04 ` Vincent Pelletier [this message]
2005-02-25 18:58 ` Yoshinori K. Okuji
2005-04-14 3:31 ` Hollis Blanchard
2005-04-14 7:13 ` Vincent Pelletier
2005-04-14 14:08 ` Vincent Pelletier
2005-05-09 2:06 ` Hollis Blanchard
2005-04-14 11:37 ` Yoshinori K. Okuji
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=421F68C9.8050504@yahoo.fr \
--to=subdino2004@yahoo.fr \
--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.