If there are multiple escapes, pick the first.
This commit is contained in:
parent
91d4ded3fd
commit
4ed634383f
2 changed files with 6 additions and 1 deletions
|
@ -348,6 +348,7 @@ std::string UnescapeMenuString(const char *input, char *shortcutChar) {
|
|||
std::string output;
|
||||
output.reserve(len);
|
||||
bool escaping = false;
|
||||
bool escapeFound = false;
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if (input[i] == '&') {
|
||||
if (escaping) {
|
||||
|
@ -358,8 +359,9 @@ std::string UnescapeMenuString(const char *input, char *shortcutChar) {
|
|||
}
|
||||
} else {
|
||||
output.push_back(input[i]);
|
||||
if (escaping && shortcutChar) {
|
||||
if (escaping && shortcutChar && !escapeFound) {
|
||||
*shortcutChar = input[i];
|
||||
escapeFound = true;
|
||||
}
|
||||
escaping = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue