fix: Opening files with unicode names through the command line

This commit is contained in:
WerWolv
2022-10-07 10:14:24 +02:00
parent 210106901e
commit 484481f886
3 changed files with 26 additions and 2 deletions

View File

@@ -54,8 +54,10 @@ int main(int argc, char **argv, char **envp) {
if (argc == 1)
; // No arguments provided
else if (argc >= 2) {
for (auto i = 1; i < argc; i++)
EventManager::post<RequestOpenFile>(argv[i]);
for (auto i = 1; i < argc; i++) {
if (auto argument = ImHexApi::System::getProgramArgument(i); argument.has_value())
EventManager::post<RequestOpenFile>(argument.value());
}
}
try {