Fixing bug 541:
The arguments passed on the command-line were not checked if they were files before being opened. This caused StyledEdit to crash if a directory was one of the arguments. Now each argument being passed is checked to see if it is a file before being opened, and if all arguments are directories, an empty document will be opened. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17235 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5e09d5dbe5
commit
649ddde05f
@ -220,7 +220,11 @@ StyledEditApp::ArgvReceived(int32 argc, const char* argv[], const char* cwd)
|
||||
fprintf(stderr, "Entry not found: \"%s\".\n", path.Path());
|
||||
continue;
|
||||
}
|
||||
OpenDocument(&ref);
|
||||
BEntry entry(&ref);
|
||||
if (entry.IsFile())
|
||||
OpenDocument(&ref);
|
||||
else if (fWindowCount == 0)
|
||||
OpenDocument();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user