All of lore.kernel.org
 help / color / mirror / Atom feed
From: phcoder <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Remove trailing space from FAT label
Date: Wed, 04 Feb 2009 13:01:55 +0100	[thread overview]
Message-ID: <498983B3.8090904@gmail.com> (raw)

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

Hello. Here is the patch to remove trailing spaces from FAT label. These 
spaces generally aren't considiered to be part of label
Thanks
Vladimir 'phcoder' Serbinenko

[-- Attachment #2: fatlabel.diff --]
[-- Type: text/x-diff, Size: 915 bytes --]

Index: fs/fat.c
===================================================================
--- fs/fat.c	(revision 1973)
+++ fs/fat.c	(working copy)
@@ -809,7 +809,13 @@
 
       if (dir.attr == GRUB_FAT_ATTR_VOLUME_ID)
 	{
-	  *label = grub_strndup ((char *) dir.name, 11);
+	  int labellen = 0, i;
+	  for (i = 0; i < 11; i++)
+	    if (dir.name[i] != ' ')
+	      labellen = i + 1;
+
+	  *label = grub_strndup ((char *) dir.name, labellen);
+	  
 	  return GRUB_ERR_NONE;
 	}
     }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 1973)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2009-02-04  Vladimir Serbinenko  <phcoder@gmail.com>
+
+	Remove trailing spaces from FAT label
+
+	* fs/fat.c (grub_fat_label): Remove trailing spaces
+
 2009-02-04  Felix Zielcke  <fzielcke@z-51.de>
 
 	util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and

             reply	other threads:[~2009-02-04 12:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 12:01 phcoder [this message]
2009-02-04 16:32 ` Remove trailing space from FAT label Pavel Roskin
2009-02-04 18:15   ` phcoder
2009-02-07 22:36 ` Robert Millan

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=498983B3.8090904@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.