Skip to content
This repository was archived by the owner on Jan 12, 2020. It is now read-only.

Commit

Permalink
[SimpleWallet] Use first 20 characters of wallet base filename for pr…
Browse files Browse the repository at this point in the history
…ompt.
  • Loading branch information
mtl1979 committed Oct 22, 2019
1 parent 5e5c20f commit 7ac1680
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/SimpleWallet/SimpleWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,16 @@ ColouredMsg getPrompt(std::shared_ptr<WalletInfo> &walletInfo)
walletName = walletInfo->walletFileName.substr(0, extPos);
}

std::string shortName = walletName.substr(0, promptLength);
std::string shortName = walletName;
size_t pos;

if ((pos = shortName.rfind("\\")) != std::string::npos) {
shortName = shortName.substr(pos + 1, promptLength);
} else if ((pos = shortName.rfind("/")) != std::string::npos) {
shortName = shortName.substr(pos + 1, promptLength);
} else if (shortName.length() > promptLength) {
shortName = shortName.substr(0, promptLength);
}

return InformationMsg("[BTOR " + shortName + "]: ");
}
Expand Down

0 comments on commit 7ac1680

Please sign in to comment.