All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mierswa <impulze@impulze.org>
To: grub-devel@gnu.org
Subject: Re: [PATCH] caseless uuid detection, fixed wrong behaviour for strncasecmp, added strcasecmp
Date: Mon, 26 Jan 2009 19:28:01 +0100	[thread overview]
Message-ID: <497E00B1.3090001@impulze.org> (raw)
In-Reply-To: <1232944909.1604.18.camel@dv>


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

On 26.01.2009 05:41, Pavel Roskin wrote:
> I'll appreciate if you write your Changelog entries according to the GNU
> coding standards.  In particular, please don't abbreviate function
> names.
Ok, second try.

> We have a very similar function search_fs_uuid() in disk/fs_uuid.c, and
> it still uses grub_strcmp().  Should it be using grub_strcasecmp() as
> well?  Can we export that function to reuse it in commands/search.c?
Yes it should use grub_strcasecmp, thanks for noticing. I don't know
exactly if we can reuse that function at another place. I leave that to
someone who knows where this code is executed. :-)


-- 
Mierswa, Daniel

If you still don't like it, that's ok: that's why I'm boss. I simply
know better than you do.
               --- Linus Torvalds, comp.os.linux.advocacy, 1996/07/22

[-- Attachment #1.2: grub2_caseless_uuid.patch --]
[-- Type: text/plain, Size: 772 bytes --]

Index: commands/search.c
===================================================================
--- commands/search.c	(revision 1954)
+++ commands/search.c	(working copy)
@@ -115,7 +115,7 @@
 	      (fs->uuid) (dev, &uuid);
 	      if (grub_errno == GRUB_ERR_NONE && uuid)
 		{
-		  if (grub_strcmp (uuid, key) == 0)
+		  if (grub_strcasecmp (uuid, key) == 0)
 		    {
 		      /* Found!  */
 		      count++;
Index: disk/fs_uuid.c
===================================================================
--- disk/fs_uuid.c	(revision 1954)
+++ disk/fs_uuid.c	(working copy)
@@ -52,7 +52,7 @@
 		{
 		  (*count)++;
 
-		  if (grub_strcmp (uuid, key) == 0)
+		  if (grub_strcasecmp (uuid, key) == 0)
 		    {
 		      ret = dev;
 		      grub_free (uuid);

[-- Attachment #1.3: ChangeLog --]
[-- Type: text/plain, Size: 484 bytes --]

2009-01-23  Daniel Mierswa <impulze@impulze.org>
	* kern/misc.c: add grub_strcasecmp for consistency reasons, use grub_size_t
	               instead of int for str-functions, fix grub_strncasecmp
	               return values, use the same algorithm in both str-functions
	* include/grub/misc.h: add grub_strcasecmp, use grub_size_t for
	                       grub_strncasecmp

2009-01-23  Daniel Mierswa <impulze@impulze.org>
	* commands/search.c: caseless UUID comparing

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

  reply	other threads:[~2009-01-26 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 12:08 [PATCH] caseless uuid detection, fixed wrong behaviour for strncasecmp, added strcasecmp Daniel Mierswa
2009-01-21 17:30 ` Pavel Roskin
2009-01-23  9:51   ` Daniel Mierswa
2009-01-26  4:41     ` Pavel Roskin
2009-01-26 18:28       ` Daniel Mierswa [this message]
2009-01-28  1:49         ` Pavel Roskin
2009-01-28  4:02           ` Pavel Roskin
2009-01-28  8:31             ` ebik

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=497E00B1.3090001@impulze.org \
    --to=impulze@impulze.org \
    --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.