]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/SemiHosting: Recognise '.' directory as the root directory.
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Jan 2013 11:49:08 +0000 (11:49 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Jan 2013 11:49:08 +0000 (11:49 +0000)
Add '.' to the list of directories recognised as the root directory
of semi-hosting.

This is important for EdkShell because listing files in the root directory
of semi-hosting (e.g. ls fsnt0:) is tranformed in a way that uses '.'
Without this patch this results in EdkShell hanging and returning
an "Out of resources" error in the end. With this patch the command
is immediately recognised as unsupported.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14089 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c

index e6604ba0e23bf15aca3a5f41c65ec862914648be..5c70e51ce7544f5ad6813806317dfd503bd90087 100644 (file)
@@ -177,8 +177,11 @@ FileOpen (
     *AsciiPtr++ = *FileName++ & 0xFF;\r
   }\r
 \r
-  if ((AsciiStrCmp (AsciiFileName, "\\") == 0) || (AsciiStrCmp (AsciiFileName, "/") == 0) || (AsciiStrCmp (AsciiFileName, "") == 0)) {\r
-    // Opening '/', '\', or the NULL pathname is trying to open the root directory\r
+  if ((AsciiStrCmp (AsciiFileName, "\\") == 0) ||\r
+      (AsciiStrCmp (AsciiFileName, "/")  == 0) ||\r
+      (AsciiStrCmp (AsciiFileName, "")   == 0) ||\r
+      (AsciiStrCmp (AsciiFileName, ".")  == 0)) {\r
+    // Opening '/', '\', '.', or the NULL pathname is trying to open the root directory\r
     IsRoot = TRUE;\r
 \r
     // Root directory node doesn't have a name.\r