From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LUkfj-0007yz-C6 for mharc-grub-devel@gnu.org; Wed, 04 Feb 2009 11:32:19 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUkfh-0007yG-JN for grub-devel@gnu.org; Wed, 04 Feb 2009 11:32:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUkff-0007x5-Na for grub-devel@gnu.org; Wed, 04 Feb 2009 11:32:17 -0500 Received: from [199.232.76.173] (port=38977 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUkff-0007wv-JG for grub-devel@gnu.org; Wed, 04 Feb 2009 11:32:15 -0500 Received: from c60.cesmail.net ([216.154.195.49]:41273) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1LUkff-0000oU-0N for grub-devel@gnu.org; Wed, 04 Feb 2009 11:32:15 -0500 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 04 Feb 2009 11:32:12 -0500 Received: from [192.168.0.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 6945434C6A for ; Wed, 4 Feb 2009 11:47:59 -0500 (EST) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <498983B3.8090904@gmail.com> References: <498983B3.8090904@gmail.com> Content-Type: text/plain Date: Wed, 04 Feb 2009 11:32:09 -0500 Message-Id: <1233765129.2487.10.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 (2.24.3-1.fc10) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: Remove trailing space from FAT label 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: Wed, 04 Feb 2009 16:32:17 -0000 On Wed, 2009-02-04 at 13:01 +0100, phcoder wrote: > Hello. Here is the patch to remove trailing spaces from FAT label. These > spaces generally aren't considiered to be part of label Suppose the label is "DOS \0DDDDDDDD", then your algorithm will fail to strip the final space, as it would iterate past the binary null. I don't know if it can happen, but I guess it's better to be prepared. Also, please see how ordinary 8.3 filenames are handled. Look for "8.3" in fs/fat.c. grub_isspace() is used to check for spaces. Binary nulls and spaces terminate the name. There may be no spaces anywhere in the name. Perhaps we could use the same mechanism for the label except that no "." is added. -- Regards, Pavel Roskin