Skip to content

Commit 50c4afa

Browse files
committed
add newline after -stdin*
1 parent 7f11fba commit 50c4afa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ static int CommandLineRPC(int argc, char *argv[])
421421
if (!std::getline(std::cin, rpcPass)) {
422422
throw std::runtime_error("-stdinrpcpass specified but failed to read from standard input");
423423
}
424+
if (StdinTerminal()) {
425+
fputc('\n', stdout);
426+
}
424427
gArgs.ForceSetArg("-rpcpassword", rpcPass);
425428
}
426429
std::vector<std::string> args = std::vector<std::string>(&argv[1], &argv[argc]);
@@ -437,6 +440,9 @@ static int CommandLineRPC(int argc, char *argv[])
437440
if (!std::getline(std::cin, walletPass)) {
438441
throw std::runtime_error("-stdinwalletpassphrase specified but failed to read from standard input");
439442
}
443+
if (StdinTerminal()) {
444+
fputc('\n', stdout);
445+
}
440446
args.insert(args.begin() + 1, walletPass);
441447
}
442448
if (gArgs.GetBoolArg("-stdin", false)) {
@@ -445,6 +451,9 @@ static int CommandLineRPC(int argc, char *argv[])
445451
while (std::getline(std::cin, line)) {
446452
args.push_back(line);
447453
}
454+
if (StdinTerminal()) {
455+
fputc('\n', stdout);
456+
}
448457
}
449458
std::unique_ptr<BaseRequestHandler> rh;
450459
std::string method;

0 commit comments

Comments
 (0)