summaryrefslogtreecommitdiffstats
path: root/dalvikvm
diff options
context:
space:
mode:
Diffstat (limited to 'dalvikvm')
-rw-r--r--dalvikvm/dalvikvm.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/dalvikvm/dalvikvm.cc b/dalvikvm/dalvikvm.cc
index ea8461f..3486c1d 100644
--- a/dalvikvm/dalvikvm.cc
+++ b/dalvikvm/dalvikvm.cc
@@ -152,15 +152,7 @@ static int dalvikvm(int argc, char** argv) {
return EXIT_FAILURE;
}
- // Make sure they provided a class name.
- if (arg_idx == argc) {
- fprintf(stderr, "Class name required\n");
- return EXIT_FAILURE;
- }
-
- // insert additional internal options here
-
- if (curr_opt >= option_count) {
+ if (curr_opt > option_count) {
fprintf(stderr, "curr_opt(%d) >= option_count(%d)\n", curr_opt, option_count);
abort();
return EXIT_FAILURE;
@@ -187,6 +179,14 @@ static int dalvikvm(int argc, char** argv) {
return EXIT_FAILURE;
}
+ // Make sure they provided a class name. We do this after
+ // JNI_CreateJavaVM so that things like "-help" have the opportunity
+ // to emit a usage statement.
+ if (arg_idx == argc) {
+ fprintf(stderr, "Class name required\n");
+ return EXIT_FAILURE;
+ }
+
int rc = InvokeMain(env, &argv[arg_idx]);
#if defined(NDEBUG)