mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +00:00
test-imap: Prefer Core::File over DeprecatedFile
This commit is contained in:
parent
b10106fc7d
commit
b65d49669a
1 changed files with 4 additions and 4 deletions
|
@ -5,11 +5,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/DeprecatedFile.h>
|
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/GetPassword.h>
|
#include <LibCore/GetPassword.h>
|
||||||
#include <LibIMAP/Client.h>
|
#include <LibIMAP/Client.h>
|
||||||
#include <LibMain/Main.h>
|
#include <LibMain/Main.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
DeprecatedString username;
|
DeprecatedString username;
|
||||||
Core::SecretString password;
|
Core::SecretString password;
|
||||||
|
|
||||||
bool interactive_password;
|
bool interactive_password;
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
|
@ -38,8 +37,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
if (interactive_password) {
|
if (interactive_password) {
|
||||||
password = TRY(Core::get_password());
|
password = TRY(Core::get_password());
|
||||||
} else {
|
} else {
|
||||||
auto standard_input = Core::DeprecatedFile::standard_input();
|
auto standard_input = TRY(Core::File::standard_input());
|
||||||
password = Core::SecretString::take_ownership(standard_input->read_all());
|
// This might leave the clear password in unused memory, but this is only a test program anyway.
|
||||||
|
password = Core::SecretString::take_ownership(TRY(standard_input->read_until_eof()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::EventLoop loop;
|
Core::EventLoop loop;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue