]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix <.><..> can not work correctly on NT32 platform.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Jun 2009 03:11:36 +0000 (03:11 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Jun 2009 03:11:36 +0000 (03:11 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8449 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c

index c267cf2a1aa6ec98d35cfd3b246deae32447b763..7da3eef9ce580bc9a501c049ff14e2cc80d2a2e9 100644 (file)
@@ -902,10 +902,11 @@ OpenRoot:
   }\r
 \r
   //\r
   }\r
 \r
   //\r
-  // If file name does not equal to "." or "..",\r
+  // If file name does not equal to "." or ".." and not trailed with "\..",\r
   // then we trim the leading/trailing blanks and trailing dots\r
   //\r
   // then we trim the leading/trailing blanks and trailing dots\r
   //\r
-  if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0) {\r
+  if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0 && \r
+    ((StrLen (FileName) >= 3) ? (StrCmp (&FileName[StrLen (FileName) - 3], L"\\..") != 0) : TRUE)) {\r
     //\r
     // Trim leading blanks\r
     //\r
     //\r
     // Trim leading blanks\r
     //\r
@@ -1255,7 +1256,7 @@ OpenRoot:
     WinNtSimpleFileSystemSetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, InfoSize, Info);\r
   }\r
 \r
     WinNtSimpleFileSystemSetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, InfoSize, Info);\r
   }\r
 \r
-Done: ;\r
+Done:\r
   FreePool (FileName);\r
 \r
   if (EFI_ERROR (Status)) {\r
   FreePool (FileName);\r
 \r
   if (EFI_ERROR (Status)) {\r