Patchwork PR java/45773: Arg processing is broken in jvgenmain

login
register
mail settings
Submitter Andrew Haley
Date Sept. 28, 2010, 9:48 a.m.
Message ID <4CA1B9EA.8090908@redhat.com>
Download mbox | patch
Permalink /patch/65949/
State New
Headers show

Comments

Andrew Haley - Sept. 28, 2010, 9:48 a.m.
Fixed thusly.

Andrew.


2010-09-27  Andrew Haley  <aph@redhat.com>

        PR java/45773
        * jvgenmain.c (main): Fix arg processing.

2Index: jvgenmain.c

Patch

===================================================================
--- jvgenmain.c (revision 164650)
+++ jvgenmain.c (working copy)
@@ -123,8 +123,12 @@ 
   for (i = 1; i < last_arg; ++i)
     {
       const char *p;
+
+      if (strcmp (argv[i], "-D") == 0)
+       continue;
+
       fprintf (stream, "  \"");
-      for (p = &argv[i][2]; *p; ++p)
+      for (p = argv[i]; *p; ++p)
        {
          if (! ISPRINT (*p))
            fprintf (stream, "\\%o", *p);