diff options
author | Marcus Nilsson <brainbomb@gmail.com> | 2022-01-07 15:18:45 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-01-08 06:19:09 -0800 |
commit | d2b99010e4b5b4457828d91799649517399d0075 (patch) | |
tree | d4eb2c5db531aa4623a7a05378d6d4182c16b786 /Userland/Utilities | |
parent | e8c71605b9eb652aed82f11f185a06ac5bd8990d (diff) | |
download | serenity-d2b99010e4b5b4457828d91799649517399d0075.zip |
jp: Use File::standard_input() when reading from stdin
Trying to open '/dev/stdin' resulted in ENOENT. Instead use the
standard_input() helper to get the File.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/jp.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Utilities/jp.cpp b/Userland/Utilities/jp.cpp index 99612c1adb..1523e01254 100644 --- a/Userland/Utilities/jp.cpp +++ b/Userland/Utilities/jp.cpp @@ -36,10 +36,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) VERIFY(spaces_in_indent >= 0); args_parser.parse(arguments); + RefPtr<Core::File> file; if (path == nullptr) - path = "/dev/stdin"sv; - - auto file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly)); + file = Core::File::standard_input(); + else + file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly)); TRY(Core::System::pledge("stdio")); |