DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37429>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37429

           Summary: jsvc does not set procname correctly. Incorrect argument
                    parsing
           Product: Tomcat 5
           Version: 5.5.12
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Native:Packaging
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Support for -procname was added to jsvc, which is great.
However, the order in which the arguments are processed
is incorrect. The argument processor complains that 
-procname is not recognized. Reorganizing the check for
-procname so that it is before the "Invalid option"
check solves the issue:

(This patch also gets rid of a compiler warning for unnecessary
 char *temp variable)

--- arguments.c 2005-05-17 06:13:39.000000000 -0700
+++ /tmp/arguments.c    2005-11-08 14:18:04.000000000 -0800
@@ -186,16 +186,17 @@
         } else if (strstr(argv[x],"-ea")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);

-        } else if (strstr(argv[x],"-")==argv[x]) {
-            log_error("Invalid option %s",argv[x]);
-            return(NULL);
-
         } else if (strcmp(argv[x],"-procname") == 0) {
             args->procname = optional(argc, argv, x++);
             if(args->procname == NULL) {
               log_error("Invalid process name specified");
               return (NULL);
             }
+
+        } else if (strstr(argv[x],"-")==argv[x]) {
+            log_error("Invalid option %s",argv[x]);
+            return(NULL);
+
         } else {
             args->clas=strdup(argv[x]);
             break;
@@ -248,7 +249,6 @@
     }

     if (log_debug_flag==true) {
-        char *temp;

         log_debug("+-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------");

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to