diff --git a/src/cli/keepassxc-cli.cpp b/src/cli/keepassxc-cli.cpp index a9b276fda..5d326f46e 100644 --- a/src/cli/keepassxc-cli.cpp +++ b/src/cli/keepassxc-cli.cpp @@ -158,7 +158,7 @@ void enterInteractiveMode(const QStringList& arguments) auto cmd = Commands::getCommand(args[0]); if (!cmd) { - err << QObject::tr("Unknown command %1").arg(args[0]) << "\n"; + err << QObject::tr("Unknown command %1").arg(args[0]) << endl; continue; } else if (cmd->name == "quit" || cmd->name == "exit") { break; @@ -167,6 +167,7 @@ void enterInteractiveMode(const QStringList& arguments) cmd->currentDatabase = currentDatabase; cmd->execute(args); currentDatabase = cmd->currentDatabase; + cmd->currentDatabase.reset(); } if (currentDatabase) {