Normalize path always and use it to check if it exists, not argc.

This commit is contained in:
Riccardo Mottola 2025-04-01 01:34:27 +02:00
parent 4faee2de0b
commit e3da52aae3

View file

@ -100,7 +100,8 @@ main(int argc, char** argv, char **env_c)
if (filetoopen)
{
exists = [fm fileExistsAtPath: arg isDirectory: &isDir];
filetoopen = absolutePath(fm, filetoopen);
exists = [fm fileExistsAtPath: filetoopen isDirectory: &isDir];
if (exists == NO)
{
if ([filetoopen hasPrefix: @"/"] == NO
@ -111,7 +112,6 @@ main(int argc, char** argv, char **env_c)
}
else
{
filetoopen = absolutePath(fm, filetoopen);
[workspace openFile: filetoopen
withApplication: application];
}