diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-10-14 13:18:15 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-10-14 13:18:15 +0000 |
commit | ac7b8ddf65e72ce632310cce7b0c831095ca81e6 (patch) | |
tree | 724bdfadbd28bddf5c443acf1a7c2377f3021b55 /ACE/ace | |
parent | 694815d2ec8d2a87555ee8db92e74d6079ea24d7 (diff) | |
download | ATCD-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')
-rw-r--r-- | ACE/ace/Process.cpp | 12 | ||||
-rw-r--r-- | ACE/ace/Process.h | 8 |
2 files changed, 15 insertions, 5 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; } diff --git a/ACE/ace/Process.h b/ACE/ace/Process.h index fe01a050526..7ed719b06fc 100644 --- a/ACE/ace/Process.h +++ b/ACE/ace/Process.h @@ -84,7 +84,8 @@ public: ACE_Process_Options (bool inherit_environment = true, size_t command_line_buf_len = DEFAULT_COMMAND_LINE_BUF_LEN, size_t env_buf_len = ENVIRONMENT_BUFFER, - size_t max_env_args = MAX_ENVIRONMENT_ARGS); + size_t max_env_args = MAX_ENVIRONMENT_ARGS, + size_t max_cmdline_args = MAX_COMMAND_LINE_OPTIONS); /// Destructor. ~ACE_Process_Options (void); @@ -440,8 +441,11 @@ protected: /// Max length of command_line_buf_ size_t command_line_buf_len_; + /// Maximum number of command-line arguments. Configurable + size_t max_command_line_args_; + /// Argv-style command-line arguments. - ACE_TCHAR *command_line_argv_[MAX_COMMAND_LINE_OPTIONS]; + ACE_TCHAR **command_line_argv_; /// Process-group on Unix; unused on Win32. pid_t process_group_; |