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:
Ryan Leavengood 2006-04-26 05:28:55 +00:00
parent 5e09d5dbe5
commit 649ddde05f
1 changed files with 5 additions and 1 deletions

View File

@ -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();
}
}