From 1ea3171660e62b5c5b18cae2c1a8a44d71f47b0b Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Fri, 25 Jan 2013 11:49:08 +0000 Subject: ArmPkg/SemiHosting: Recognise '.' directory as the root directory. 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 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14089 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ArmPkg/Filesystem') diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c index e6604ba0e2..5c70e51ce7 100644 --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c @@ -177,8 +177,11 @@ FileOpen ( *AsciiPtr++ = *FileName++ & 0xFF; } - if ((AsciiStrCmp (AsciiFileName, "\\") == 0) || (AsciiStrCmp (AsciiFileName, "/") == 0) || (AsciiStrCmp (AsciiFileName, "") == 0)) { - // Opening '/', '\', or the NULL pathname is trying to open the root directory + if ((AsciiStrCmp (AsciiFileName, "\\") == 0) || + (AsciiStrCmp (AsciiFileName, "/") == 0) || + (AsciiStrCmp (AsciiFileName, "") == 0) || + (AsciiStrCmp (AsciiFileName, ".") == 0)) { + // Opening '/', '\', '.', or the NULL pathname is trying to open the root directory IsRoot = TRUE; // Root directory node doesn't have a name. -- cgit v1.2.3