diff options
author | Tom Tromey <tromey@cygnus.com> | 1998-11-11 13:52:49 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1998-11-11 13:52:49 +0000 |
commit | 233f10d3f1e2868e86b7041cd940d896b16a60a0 (patch) | |
tree | 5d2f826baf293422f52b0a1c8366a7521f16814e /gcc | |
parent | 2a55b8e817a0cab33db7b55492a17d6e60082f78 (diff) | |
download | gcc-233f10d3f1e2868e86b7041cd940d896b16a60a0.zip gcc-233f10d3f1e2868e86b7041cd940d896b16a60a0.tar.gz gcc-233f10d3f1e2868e86b7041cd940d896b16a60a0.tar.bz2 |
* jcf-dump.c (main): Correctly recognize `--'-style long options.
From-SVN: r23607
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/java/jcf-dump.c | 52 |
2 files changed, 29 insertions, 27 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 6296bdc..0ba26ee 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +1998-11-11 Tom Tromey <tromey@cygnus.com> + + * jcf-dump.c (main): Correctly recognize `--'-style long options. + Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c (is_compiled_class): Call safe_layout_class for class diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index 7ccb97c..6276630 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -718,39 +718,37 @@ DEFUN(main, (argc, argv), { char *arg = argv[argi]; - /* Just let all arguments be given in either "-" or "--" form. */ if (arg[0] != '-' || ! strcmp (arg, "--")) break; - if (arg[0] == '-') + /* Just let all arguments be given in either "-" or "--" form. */ + if (arg[1] == '-') + ++arg; + + if (strcmp (arg, "-o") == 0 && argi + 1 < argc) + output_file = argv[++argi]; + else if (strcmp (arg, "-classpath") == 0 && argi + 1 < argc) + jcf_path_classpath_arg (argv[++argi]); + else if (strcmp (arg, "-CLASSPATH") == 0 && argi + 1 < argc) + jcf_path_CLASSPATH_arg (argv[++argi]); + else if (strncmp (arg, "-I", 2) == 0) + jcf_path_include_arg (arg + 2); + else if (strcmp (arg, "-verbose") == 0) + verbose++; + else if (strcmp (arg, "-print-main") == 0) + flag_print_main++; + else if (strcmp (arg, "-c") == 0) + flag_disassemble_methods++; + else if (strcmp (arg, "-javap") == 0) { - if (strcmp (arg, "-o") == 0 && argi + 1 < argc) - output_file = argv[++argi]; - else if (strcmp (arg, "-classpath") == 0 && argi + 1 < argc) - jcf_path_classpath_arg (argv[++argi]); - else if (strcmp (arg, "-CLASSPATH") == 0 && argi + 1 < argc) - jcf_path_CLASSPATH_arg (argv[++argi]); - else if (strncmp (arg, "-I", 2) == 0) - jcf_path_include_arg (arg + 2); - else if (strcmp (arg, "-verbose") == 0) - verbose++; - else if (strcmp (arg, "-print-main") == 0) - flag_print_main++; - else if (strcmp (arg, "-c") == 0) - flag_disassemble_methods++; - else if (strcmp (arg, "-javap") == 0) - { - flag_javap_compatible++; - flag_print_constant_pool = 0; - } - else - { - fprintf (stderr, "%s: illegal argument\n", argv[argi]); - exit (FATAL_EXIT_CODE); - } + flag_javap_compatible++; + flag_print_constant_pool = 0; } else - break; + { + fprintf (stderr, "%s: illegal argument\n", argv[argi]); + exit (FATAL_EXIT_CODE); + } } if (argi == argc) |