All of lore.kernel.org
 help / color / mirror / Atom feed
* Remove trailing space from FAT label
@ 2009-02-04 12:01 phcoder
  2009-02-04 16:32 ` Pavel Roskin
  2009-02-07 22:36 ` Robert Millan
  0 siblings, 2 replies; 4+ messages in thread
From: phcoder @ 2009-02-04 12:01 UTC (permalink / raw)
  To: The development of GRUB 2

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-07 22:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-04 12:01 Remove trailing space from FAT label phcoder
2009-02-04 16:32 ` Pavel Roskin
2009-02-04 18:15   ` phcoder
2009-02-07 22:36 ` Robert Millan

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.