Skip to content

Commit ad52f05

Browse files
committed
Escape ampersands (&) in wallet names in Open Wallet menu
1 parent 2c530ea commit ad52f05

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/qt/bitcoingui.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ void BitcoinGUI::createActions()
375375
for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
376376
const std::string& path = i.first;
377377
QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path);
378+
// Menu items remove single &. Single & are shown when && is in the string, but only the first occurrence. So replace only the first & with &&
379+
name.replace(name.indexOf(QChar('&')), 1, QString("&&"));
378380
QAction* action = m_open_wallet_menu->addAction(name);
379381

380382
if (i.second) {

0 commit comments

Comments
 (0)