mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
ShellPkg/ls: Fix to support "ls fs0:File.txt"
“ls fs0:\File.txt" can list the file correctly but when the backslash is removed from colon, the file cannot be listed. The patch fixes this issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
This commit is contained in:
parent
54b1e0ec81
commit
47ec935660
@ -2,7 +2,7 @@
|
|||||||
Main file for ls shell level 2 function.
|
Main file for ls shell level 2 function.
|
||||||
|
|
||||||
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
|
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -707,10 +707,9 @@ ShellCommandRunLs (
|
|||||||
//
|
//
|
||||||
// must split off the search part that applies to files from the end of the directory part
|
// must split off the search part that applies to files from the end of the directory part
|
||||||
//
|
//
|
||||||
for (StrnCatGrow(&SearchString, NULL, PathName, 0)
|
StrnCatGrow(&SearchString, NULL, FullPath, 0);
|
||||||
; SearchString != NULL && StrStr(SearchString, L"\\") != NULL
|
PathRemoveLastItem (FullPath);
|
||||||
; CopyMem(SearchString, StrStr(SearchString, L"\\") + 1, 1 + StrSize(StrStr(SearchString, L"\\") + 1))) ;
|
CopyMem (SearchString, SearchString + StrLen (FullPath), StrSize (SearchString + StrLen (FullPath)));
|
||||||
FullPath[StrLen(FullPath) - StrLen(SearchString)] = CHAR_NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user