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>
This commit is contained in:
Tormod Volden 2024-07-27 16:11:08 +02:00 committed by mergify[bot]
parent df884297fd
commit b21cf3bd5b
1 changed files with 3 additions and 1 deletions

View File

@ -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++;
}
}