You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2012/02/06 16:57:54 UTC

svn commit: r1241053 - in /commons/proper/daemon/branches/1.0.x: RELEASE-NOTES.txt src/native/windows/include/cmdline.h src/native/windows/src/cmdline.c src/site/xdoc/procrun.xml

Author: mturk
Date: Mon Feb  6 15:57:53 2012
New Revision: 1241053

URL: http://svn.apache.org/viewvc?rev=1241053&view=rev
Log:
DAEMON-240: Do not allow ++ and -- options on the same command line

Modified:
    commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt
    commons/proper/daemon/branches/1.0.x/src/native/windows/include/cmdline.h
    commons/proper/daemon/branches/1.0.x/src/native/windows/src/cmdline.c
    commons/proper/daemon/branches/1.0.x/src/site/xdoc/procrun.xml

Modified: commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt?rev=1241053&r1=1241052&r2=1241053&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt (original)
+++ commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt Mon Feb  6 15:57:53 2012
@@ -79,7 +79,7 @@ NEW FEATURES:
 
 BUG FIXES:
 
-1.0.9: DAEMON-232, DAEMON-233, DAEMON-234, DAEMON-237
+1.0.9: DAEMON-232, DAEMON-233, DAEMON-234, DAEMON-237, DAEMON-240
 
 1.0.8: DAEMON-195, DAEMON-215, DAEMON-216, DAEMON-218, DAEMON-219, DAEMON-220,
        DAEMON-222, DAEMON-223, DAEMON-224, DAEMON-227, DAEMON-228

Modified: commons/proper/daemon/branches/1.0.x/src/native/windows/include/cmdline.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/include/cmdline.h?rev=1241053&r1=1241052&r2=1241053&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/src/native/windows/include/cmdline.h (original)
+++ commons/proper/daemon/branches/1.0.x/src/native/windows/include/cmdline.h Mon Feb  6 15:57:53 2012
@@ -30,8 +30,8 @@ __APXBEGIN_DECLS
 #define APXCMDOPT_SRV   0x00000200  /* Save to service registry */
 #define APXCMDOPT_USR   0x00000400  /* Save to user registry */
 
-#define APXCMDOPT_FOUND 0x00001000  /* The option is present in cmdline */
-#define APXCMDOPT_ADD   0x00002000  /* The option is present in cmdline as ++*/
+#define APXCMDOPT_FOUND 0x00001000  /* The option is present in cmdline as -- */
+#define APXCMDOPT_ADD   0x00002000  /* The option is present in cmdline as ++ */
 
 
 typedef struct APXCMDLINEOPT APXCMDLINEOPT;

Modified: commons/proper/daemon/branches/1.0.x/src/native/windows/src/cmdline.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/src/cmdline.c?rev=1241053&r1=1241052&r2=1241053&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/src/native/windows/src/cmdline.c (original)
+++ commons/proper/daemon/branches/1.0.x/src/native/windows/src/cmdline.c Mon Feb  6 15:57:53 2012
@@ -179,6 +179,21 @@ LPAPXCMDLINE apxCmdlineParse(
                     lpOptions[l].dwType |= APXCMDOPT_FOUND;
                     break;
                 }
+                if (add) {
+                    if (lpOptions[l].dwType & APXCMDOPT_FOUND) {
+                        apxLogWrite(APXLOG_MARK_ERROR "Option ++%S found after --%S. "
+                                    "Intermixing --option and ++option is not allowed",
+                                    a + 2, a + 2);
+                        return NULL;
+                    }
+                    lpOptions[l].dwType |= APXCMDOPT_ADD;
+                }
+                else if (lpOptions[l].dwType & APXCMDOPT_ADD) {
+                     apxLogWrite(APXLOG_MARK_ERROR "Option --%S found after ++%S. "
+                                    "Intermixing --option and ++option is not allowed",
+                                 a + 2, a + 2);
+                     return NULL;
+                }
                 if (lpOptions[l].dwType & APXCMDOPT_STR)
                     lpOptions[l].szValue = val;
                 else if (lpOptions[l].dwType & APXCMDOPT_INT)
@@ -214,8 +229,6 @@ LPAPXCMDLINE apxCmdlineParse(
                     }
                 }
                 lpOptions[l].dwType |= APXCMDOPT_FOUND;
-                if (add)
-                    lpOptions[l].dwType |= APXCMDOPT_ADD;
                 match = l + 1;
                 break;
             }

Modified: commons/proper/daemon/branches/1.0.x/src/site/xdoc/procrun.xml
URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/site/xdoc/procrun.xml?rev=1241053&r1=1241052&r2=1241053&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/src/site/xdoc/procrun.xml (original)
+++ commons/proper/daemon/branches/1.0.x/src/site/xdoc/procrun.xml Mon Feb  6 15:57:53 2012
@@ -217,7 +217,7 @@ However some parameters can take multipl
 If these parameters are prefixed with <b>++</b>, then the value will be appended to the existing value.
 For example:
 <source>
---Startup=manual --Startup=auto --JvmOptions=-Done=1 ++JvmOptions=-Dtwo=2
+--Startup=manual --Startup=auto ++JvmOptions=-Done=1 ++JvmOptions=-Dtwo=2
 </source>
 will result in the following values being used:
 <source>
@@ -232,7 +232,11 @@ JvmOptions:
 Only multi-valued parameters support this; they are indicated in the table below by <b><code>++</code></b>.
 <br></br>
 If <b><code>++</code></b> is used for a parameter that does not support multiple values,
-then it is treated the same as <b>--</b>. No error is reported.
+then it is treated the same as <b><code>--</code></b>. No error is reported.
+<br/>
+<b>Notice:</b><br/>
+It is error to intermix <b><code>++</code></b> and <b><code>--</code></b> options on the same
+command line. Staring with version <b>1.0.9</b> procrun will refuse to continue in such cases.
 </p>
 <p>
     <table>