summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2024-07-27 16:11:08 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-04 19:34:05 +0000
commitb21cf3bd5bd75ea831471d12bd37fe07b57ae506 (patch)
treebb992c21f4f009d47c42056a6f238d517676d61c
parentdf884297fd57aac379d227925e27211e667974ee (diff)
downloadedk2-b21cf3bd5bd75ea831471d12bd37fe07b57ae506.zip
edk2-b21cf3bd5bd75ea831471d12bd37fe07b57ae506.tar.gz
edk2-b21cf3bd5bd75ea831471d12bd37fe07b57ae506.tar.bz2
ShellPkg: ShellLevel2StripQuotes: Strip consecutive quotes
When a quotation mark was found, the remaining line would be shifted in-place to get rid of it. However, the "walker" index would still be increased and therefore the first character of the shifted part would be skipped. This means a second quotation mark would not be deleted. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
index ae64399..46460ae 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
@@ -335,9 +335,11 @@ ShellLevel2StripQuotes (
return EFI_OUT_OF_RESOURCES;
}
- for (Walker = *CleanString; Walker != NULL && *Walker != CHAR_NULL; Walker++) {
+ for (Walker = *CleanString; Walker != NULL && *Walker != CHAR_NULL;) {
if (*Walker == L'\"') {
CopyMem (Walker, Walker+1, StrSize (Walker) - sizeof (Walker[0]));
+ } else {
+ Walker++;
}
}