summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-06 23:06:59 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-06 23:06:59 +0000
commit2a31cf5bbff0a47fbe7fb160803472752277a463 (patch)
treef547b4a73ec7d0dc99442466188d1b9e12802079
parent925a6d06140e5cda20cd2a36eed21801d4033f92 (diff)
downloadATCD-2a31cf5bbff0a47fbe7fb160803472752277a463.tar.gz
ChangeLogTag:Sun Jun 6 18:05:48 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--ChangeLog-99b8
-rw-r--r--ace/Process.cpp23
-rw-r--r--ace/Process.h5
3 files changed, 33 insertions, 3 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b
index b08e535ef86..379b7f43900 100644
--- a/ChangeLog-99b
+++ b/ChangeLog-99b
@@ -1,3 +1,11 @@
+Sun Jun 6 18:05:48 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * ace/Process.h:
+ * ace/Process.cpp:
+ Added const-correct version of the command_line() method, in the
+ future we should remove the non-const version, but I don't feel
+ like breaking an interface today.
+
Sun Jun 06 09:08:48 1999 David L. Levine <levine@cs.wustl.edu>
* PROBLEM-REPORT-FORM: added requests to not send
diff --git a/ace/Process.cpp b/ace/Process.cpp
index 32362e7cc03..3f6cb658e9c 100644
--- a/ace/Process.cpp
+++ b/ace/Process.cpp
@@ -521,9 +521,28 @@ ACE_Process_Options::~ACE_Process_Options (void)
int
ACE_Process_Options::command_line (LPTSTR argv[])
{
- int i;
+ int i = 0;
+
+ if (argv[i])
+ {
+ ACE_OS::strcat (command_line_buf_, argv[i]);
+ while (argv[++i])
+ {
+ ACE_OS::strcat (command_line_buf_, ACE_TEXT (" "));
+ ACE_OS::strcat (command_line_buf_, argv[i]);
+ }
+ }
+
+ return 0; // Success.
+}
+
+int
+ACE_Process_Options::command_line (LPCTSTR argv[])
+{
+ // @@ Factor out the code between this
+ int i = 0;
- if (argv[i = 0])
+ if (argv[i])
{
ACE_OS::strcat (command_line_buf_, argv[i]);
while (argv[++i])
diff --git a/ace/Process.h b/ace/Process.h
index b80b0020e12..669f7ac5c17 100644
--- a/ace/Process.h
+++ b/ace/Process.h
@@ -60,7 +60,7 @@ protected:
//
// @@ These sizes should be taken from the appropriate
// POSIX/system header files and/or defined dynamically.
- enum
+ enum
{
MAX_COMMAND_LINE_OPTIONS = 128,
ENVIRONMENT_BUFFER = 16 * 1024, // 16K
@@ -121,7 +121,10 @@ public:
// on success, -1 on failure.
int command_line (LPTSTR argv[]);
+ int command_line (LPCTSTR argv[]);
// Same as above in argv format. <argv> must be null terminated.
+ // @@ The non-const version is provided only for backwards
+ // compatibility
u_long creation_flags (void) const;
// Get.