From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1D4k6E-0002lE-Eg for mharc-grub-devel@gnu.org; Fri, 25 Feb 2005 13:22:02 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D4k45-00025L-0h for grub-devel@gnu.org; Fri, 25 Feb 2005 13:19:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D4k3l-0001vg-5t for grub-devel@gnu.org; Fri, 25 Feb 2005 13:19:31 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D4k3k-0001v6-UL for grub-devel@gnu.org; Fri, 25 Feb 2005 13:19:29 -0500 Received: from [217.12.11.36] (helo=smtp005.mail.ukl.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1D4jpj-0002Ab-32 for grub-devel@gnu.org; Fri, 25 Feb 2005 13:04:59 -0500 Received: from unknown (HELO ?192.168.0.2?) (subdino2004@83.194.37.29 with plain) by smtp005.mail.ukl.yahoo.com with SMTP; 25 Feb 2005 18:04:57 -0000 Message-ID: <421F68C9.8050504@yahoo.fr> Date: Fri, 25 Feb 2005 19:04:57 +0100 From: Vincent Pelletier User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 References: <421A4CEA.5030603@yahoo.fr> <421F118C.5000504@yahoo.fr> <5118c6fb99a015e564cf60860935ce8d@penguinppc.org> <200502251812.04315.okuji@enbug.org> In-Reply-To: <200502251812.04315.okuji@enbug.org> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PATCHv2] dprintf implementation X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2005 18:22:00 -0000 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