From 50c4afa3c420f11329cffb091b62beeb96b39183 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Thu, 14 Feb 2019 14:51:28 +0900 Subject: add newline after -stdin* --- src/bitcoin-cli.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/bitcoin-cli.cpp') diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index e1be5b7f9..73773c4ec 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 args = std::vector(&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 rh; std::string method; -- cgit v1.2.3