summaryrefslogtreecommitdiff
path: root/ACE/ace/Process.cpp
diff options
context:
space:
mode:
authormcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-10-14 13:18:15 +0000
committermcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-10-14 13:18:15 +0000
commitac7b8ddf65e72ce632310cce7b0c831095ca81e6 (patch)
tree724bdfadbd28bddf5c443acf1a7c2377f3021b55 /ACE/ace/Process.cpp
parent694815d2ec8d2a87555ee8db92e74d6079ea24d7 (diff)
downloadATCD-ac7b8ddf65e72ce632310cce7b0c831095ca81e6.tar.gz
Thu Oct 14 13:15:00 UTC 2010 Martin Corino <mcorino@remedy.nl>
* ace/Process.h: * ace/Process.cpp: Changes to allow to dynamically define the max. number of cmdline args. The tao_idl compiler was running out of room in certain instances and the static max was very conservative.
Diffstat (limited to 'ACE/ace/Process.cpp')
-rw-r--r--ACE/ace/Process.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp
index 5a0c70e482c..d60a3d2f931 100644
--- a/ACE/ace/Process.cpp
+++ b/ACE/ace/Process.cpp
@@ -796,7 +796,8 @@ ACE_Process::convert_env_buffer (const char* env) const
ACE_Process_Options::ACE_Process_Options (bool inherit_environment,
size_t command_line_buf_len,
size_t env_buf_len,
- size_t max_env_args)
+ size_t max_env_args,
+ size_t max_cmdline_args)
:
#if !defined (ACE_HAS_WINCE)
inherit_environment_ (inherit_environment),
@@ -830,6 +831,8 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment,
command_line_buf_ (0),
command_line_copy_ (0),
command_line_buf_len_ (command_line_buf_len),
+ max_command_line_args_ (max_cmdline_args),
+ command_line_argv_ (0),
process_group_ (ACE_INVALID_PID),
use_unicode_environment_ (false)
{
@@ -859,6 +862,8 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment,
this->startup_info_.cb = sizeof this->startup_info_;
#endif /* ACE_WIN32 */
#endif /* !ACE_HAS_WINCE */
+ ACE_NEW (command_line_argv_,
+ ACE_TCHAR *[max_cmdline_args]);
}
#if !defined (ACE_HAS_WINCE)
@@ -1178,6 +1183,7 @@ ACE_Process_Options::~ACE_Process_Options (void)
#endif /* !ACE_HAS_WINCE */
delete [] command_line_buf_;
ACE::strdelete (command_line_copy_);
+ delete [] command_line_argv_;
}
int
@@ -1315,12 +1321,12 @@ ACE_Process_Options::command_line_argv (void)
parser.preserve_designators ('\"', '\"'); // "
parser.preserve_designators ('\'', '\'');
- int x = 0;
+ unsigned int x = 0;
do
command_line_argv_[x] = parser.next ();
while (command_line_argv_[x] != 0
// substract one for the ending zero.
- && ++x < MAX_COMMAND_LINE_OPTIONS - 1);
+ && ++x < max_command_line_args_ - 1);
command_line_argv_[x] = 0;
}