StrCpy(NewPath, Cwd);\r
if (*Path == L'\\') {\r
Path++;\r
- while (ChopLastSlash(NewPath)) ;\r
+ while (PathRemoveLastItem(NewPath)) ;\r
}\r
StrCat(NewPath, Path);\r
DevicePathForReturn = EfiShellGetDevicePathFromFilePath(NewPath);\r
//\r
// build the full device path\r
//\r
- DevicePathForReturn = FileDevicePath(Handle, Path+StrLen(MapName)+1);\r
+ if (*(Path+StrLen(MapName)+1) == CHAR_NULL) {\r
+ DevicePathForReturn = FileDevicePath(Handle, L"\\");\r
+ } else {\r
+ DevicePathForReturn = FileDevicePath(Handle, Path+StrLen(MapName)+1);\r
+ }\r
\r
FreePool(MapName);\r
if (DevicePathCopyForFree != NULL) {\r
}\r
StrCpy(PatternCopy, FilePattern);\r
\r
- PatternCopy = CleanPath(PatternCopy);\r
+ PatternCopy = PathCleanUpDirectories(PatternCopy);\r
\r
Count = StrStr(PatternCopy, L":") - PatternCopy;\r
Count += 2;\r
CONST CHAR16 *CurDir;\r
BOOLEAN Found;\r
\r
- ShellCommandCleanPath(Path);\r
+ PathCleanUpDirectories(Path);\r
\r
Path2Size = 0;\r
Path2 = NULL;\r
StrnCatGrow(&Path2, &Path2Size, CurDir, 0);\r
if (*Path == L'\\') {\r
Path++;\r
- while (ChopLastSlash(Path2)) ;\r
+ while (PathRemoveLastItem(Path2)) ;\r
}\r
ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));\r
StrnCatGrow(&Path2, &Path2Size, Path, 0);\r
StrnCatGrow(&Path2, NULL, Path, 0);\r
}\r
\r
- CleanPath (Path2);\r
+ PathCleanUpDirectories (Path2);\r
\r
//\r
// do the search\r
DirectoryName = StrnCatGrow(&DirectoryName, NULL, Dir, 0);\r
ASSERT(DirectoryName != NULL);\r
\r
- CleanPath(DirectoryName);\r
+ PathCleanUpDirectories(DirectoryName);\r
\r
if (FileSystem == NULL) {\r
//\r
NULL,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle4);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle1);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3);\r
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4);\r
-\r
+ if (!EFI_ERROR (Status)) {\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle4);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle1);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3);\r
+ Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4);\r
+ }\r
return (Status);\r
}\r
\r
IN EFI_KEY_DATA *KeyData\r
)\r
{\r
- EFI_INPUT_KEY Key;\r
- UINTN EventIndex;\r
// ShellPrintEx(-1,-1,L" <Notify> ");\r
if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) &&\r
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))\r
} else if ((KeyData->Key.UnicodeChar == L's') &&\r
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))\r
){ \r
- //\r
- // just get some key\r
- //\r
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
- gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
+ ShellInfoObject.HaltOutput = TRUE;\r
}\r
return (EFI_SUCCESS);\r
}\r