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
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  <phco...@gmail.com>
+
+	Remove trailing spaces from FAT label
+
+	* fs/fat.c (grub_fat_label): Remove trailing spaces
+
 2009-02-04  Felix Zielcke  <fziel...@z-51.de>
 
 	util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to