]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Expand and add null terminate to end of string like function comments said in...
authorStar Zeng <star.zeng@intel.com>
Tue, 12 Mar 2013 01:51:42 +0000 (01:51 +0000)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 7 Apr 2016 06:22:43 +0000 (23:22 -0700)
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
(based on FatPkg commit 1cc9454c1223e8177ba3028bdf3fa72b52aacffe)

[jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Mark Doran <mark.doran@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
FatPkg/FatPei/FatLiteAccess.c
FatPkg/FatPei/FatLiteLib.c

index 53f5e3f60cbbc118c01846b66fc99e9ea43257bb..110634508bf497905c261da81f7dc77e3019ce14 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FAT file system access routines for FAT recovery PEIM\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
@@ -475,7 +475,7 @@ FatReadNextDirectoryEntry (
     // We only search for *FILE* in root directory\r
     // Long file name entry is *NOT* supported\r
     //\r
-    if ((DirEntry.Attributes == FAT_ATTR_DIRECTORY) || (DirEntry.Attributes == FAT_ATTR_LFN)) {\r
+    if (((DirEntry.Attributes & FAT_ATTR_DIRECTORY) == FAT_ATTR_DIRECTORY) || (DirEntry.Attributes == FAT_ATTR_LFN)) {\r
       continue;\r
     }\r
     //\r
index b5191b6706f01dfe21dc5762e687e36bee6033c4..06f031defe6924ff6870747699b258c8a6505a5f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   General purpose supporting routines for FAT recovery PEIM\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
@@ -317,15 +317,16 @@ EngFatToStr (
   // No DBCS issues, just expand and add null terminate to end of string\r
   //\r
   while (*Fat != 0 && FatSize != 0) {\r
+    if (*Fat == ' ') {\r
+      break;\r
+    }\r
     *String = *Fat;\r
     String += 1;\r
     Fat += 1;\r
     FatSize -= 1;\r
-    if (*Fat == ' ') {\r
-      *String = 0;\r
-      return ;\r
-    }\r
   }\r
+\r
+  *String = 0;\r
 }\r
 \r
 \r