Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove strncmp(). It enables to process various options.
  • Loading branch information
monaka committed Mar 16, 2013
1 parent 2e937a5 commit abf1b18
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/driver.c
Expand Up @@ -71,9 +71,11 @@ main(int argc, char **argv)
return EXIT_FAILURE;
}

if (argc == 2 && strncmp(argv[1], "-v", 2) == 0) {
printf("verbose mode: enable\n\n");
mrb_gv_set(mrb, mrb_intern(mrb, "$mrbtest_verbose"), mrb_true_value());
if (argc == 2 && argv[1][0] == '-') {
if (argv[1][1] == 'v') {
printf("verbose mode: enable\n\n");
mrb_gv_set(mrb, mrb_intern(mrb, "$mrbtest_verbose"), mrb_true_value());
}
}

mrb_init_mrbtest(mrb);
Expand Down

0 comments on commit abf1b18

Please sign in to comment.