1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 05:48:12 +00:00

checksum: Make name detection working even with a path

This commit is contained in:
Michel Hermier 2022-01-04 11:28:20 +01:00 committed by Ali Mohammad Pur
parent 0c09617b48
commit 23fe07a148

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/LexicalPath.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <LibCore/System.h>
@ -15,7 +16,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath", nullptr));
auto program_name = arguments.strings[0];
auto program_name = LexicalPath::basename(arguments.strings[0]);
auto hash_kind = Crypto::Hash::HashKind::None;
if (program_name == "md5sum")