aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2019-02-14 14:51:28 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2019-10-01 12:19:31 +0900
commit50c4afa3c420f11329cffb091b62beeb96b39183 (patch)
tree5849b329010625b08ad508a5a1a5753c9fb7c6a9 /src/bitcoin-cli.cpp
parent7f11fba2e3c7b1e00ffb98504cdcfc2ded9c09cf (diff)
downloadbitcoin-50c4afa3c420f11329cffb091b62beeb96b39183.tar.xz
add newline after -stdin*
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index e1be5b7f92..73773c4ec5 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -421,6 +421,9 @@ static int CommandLineRPC(int argc, char *argv[])
if (!std::getline(std::cin, rpcPass)) {
throw std::runtime_error("-stdinrpcpass specified but failed to read from standard input");
}
+ if (StdinTerminal()) {
+ fputc('\n', stdout);
+ }
gArgs.ForceSetArg("-rpcpassword", rpcPass);
}
std::vector<std::string> args = std::vector<std::string>(&argv[1], &argv[argc]);
@@ -437,6 +440,9 @@ static int CommandLineRPC(int argc, char *argv[])
if (!std::getline(std::cin, walletPass)) {
throw std::runtime_error("-stdinwalletpassphrase specified but failed to read from standard input");
}
+ if (StdinTerminal()) {
+ fputc('\n', stdout);
+ }
args.insert(args.begin() + 1, walletPass);
}
if (gArgs.GetBoolArg("-stdin", false)) {
@@ -445,6 +451,9 @@ static int CommandLineRPC(int argc, char *argv[])
while (std::getline(std::cin, line)) {
args.push_back(line);
}
+ if (StdinTerminal()) {
+ fputc('\n', stdout);
+ }
}
std::unique_ptr<BaseRequestHandler> rh;
std::string method;