summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACE/ACEXML/parser/parser/Parser.cpp2
-rw-r--r--ACE/examples/ConfigViewer/ValueListCtrl.cpp6
-rw-r--r--ACE/tests/CDR_Array_Test.cpp2
-rw-r--r--TAO/MPC/config/tao_idl_fe.mpb2
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp2
-rw-r--r--TAO/TAO_IDL/driver/drv_preproc.cpp78
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp2
7 files changed, 74 insertions, 20 deletions
diff --git a/ACE/ACEXML/parser/parser/Parser.cpp b/ACE/ACEXML/parser/parser/Parser.cpp
index 31e2238a5b1..e2b15addab0 100644
--- a/ACE/ACEXML/parser/parser/Parser.cpp
+++ b/ACE/ACEXML/parser/parser/Parser.cpp
@@ -713,7 +713,7 @@ ACEXML_Parser::parse_element (int is_root)
&& ACE_OS::strcmp (startname, this->doctype_) != 0)
{
this->fatal_error (ACE_TEXT ("Root element different from DOCTYPE"));
- return ;
+ return;
}
ACEXML_AttributesImpl attributes;
ACEXML_Char ch;
diff --git a/ACE/examples/ConfigViewer/ValueListCtrl.cpp b/ACE/examples/ConfigViewer/ValueListCtrl.cpp
index 2c4fba57dc1..53bbc04cdc5 100644
--- a/ACE/examples/ConfigViewer/ValueListCtrl.cpp
+++ b/ACE/examples/ConfigViewer/ValueListCtrl.cpp
@@ -101,7 +101,7 @@ void ValueListCtrl::OnModify(wxCommandEvent& event)
long Item = GetSelectedItem();
if(Item == -1)
{
- return ;
+ return;
}
wxListItem ListItem;
ACE_Configuration::VALUETYPE Type = (ACE_Configuration::VALUETYPE)GetItemData(Item);
@@ -159,7 +159,7 @@ void ValueListCtrl::OnDelete(wxCommandEvent& event)
long Item = GetSelectedItem();
if(Item == -1)
{
- return ;
+ return;
}
wxString Text = GetItemText(Item);
m_pConfig->remove_value(m_Key, Text);
@@ -171,7 +171,7 @@ void ValueListCtrl::OnRename(wxCommandEvent& event)
long Item = GetSelectedItem();
if(Item == -1)
{
- return ;
+ return;
}
wxListItem ListItem;
ACE_Configuration::VALUETYPE Type = (ACE_Configuration::VALUETYPE)GetItemData(Item);
diff --git a/ACE/tests/CDR_Array_Test.cpp b/ACE/tests/CDR_Array_Test.cpp
index d20d9b9123d..a051dcfa379 100644
--- a/ACE/tests/CDR_Array_Test.cpp
+++ b/ACE/tests/CDR_Array_Test.cpp
@@ -180,7 +180,7 @@ CDR_Test<T, H>::CDR_Test (int total, int niter, int use_array)
{
if (total <= 0)
{
- return ;
+ return;
}
char* srcbuf;
diff --git a/TAO/MPC/config/tao_idl_fe.mpb b/TAO/MPC/config/tao_idl_fe.mpb
index 4c9ff5d1e6e..bcc73c92ef9 100644
--- a/TAO/MPC/config/tao_idl_fe.mpb
+++ b/TAO/MPC/config/tao_idl_fe.mpb
@@ -1,6 +1,6 @@
// -*- MPC -*-
project: acelib, conv_lib {
- includes += $(TAO_ROOT)/TAO_IDL/fe $(TAO_ROOT)/TAO_IDL/include
+ includes += $(TAO_ROOT)/TAO_IDL/fe $(TAO_ROOT)/TAO_IDL/include $(TAO_ROOT)
after += TAO_IDL_FE
libs += TAO_IDL_FE
}
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 09379c3b6ee..af681500bcf 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -109,7 +109,7 @@ be_interface::be_interface (UTL_ScopedName *n,
|| nt == AST_Decl::NT_valuetype
|| nt == AST_Decl::NT_eventtype)
{
- return ;
+ return;
}
if (this->is_defined ())
diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp
index f512dc7fd79..19df12c6286 100644
--- a/TAO/TAO_IDL/driver/drv_preproc.cpp
+++ b/TAO/TAO_IDL/driver/drv_preproc.cpp
@@ -70,6 +70,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "fe_extern.h"
#include "drv_extern.h"
#include "utl_string.h"
+#include "utl_err.h"
+
#include "ace/Version.h"
#include "ace/Process_Manager.h"
#include "ace/SString.h"
@@ -138,22 +140,68 @@ DRV_cpp_putarg (const char *str)
throw Bailout ();
}
- if (str && ACE_OS::strchr (str, ' ') && !ACE_OS::strchr (str, '"'))
+ char *replace = nullptr;
+ if (str)
{
- ACE_TCHAR *buf = nullptr;
- ACE_NEW_NORETURN (buf, ACE_TCHAR[ACE_OS::strlen (str) + 3]);
- if (buf)
+ const char *const first_quote = ACE_OS::strchr (str, '"');
+ bool allocate_error = false;
+
+ if (ACE_OS::strchr (str, ' ') && !first_quote)
+ {
+ ACE_NEW_NORETURN (replace, char[ACE_OS::strlen (str) + 3]);
+ allocate_error = !replace;
+ if (replace)
+ {
+ replace[0] = '"';
+ ACE_OS::strcpy (replace + 1, str);
+ ACE_OS::strcat (replace, "\"");
+ }
+ }
+#ifdef ACE_WIN32
+ else if (first_quote)
+ {
+ // Escape Doublequotes on Windows
+
+ size_t quote_count = 0;
+ for (const char *quote = first_quote; quote; quote = ACE_OS::strchr (quote, '"'))
+ {
+ ++quote_count;
+ ++quote;
+ }
+
+ ACE_NEW_NORETURN (replace, char[ACE_OS::strlen (str) + quote_count + 1]);
+ allocate_error = !replace;
+ if (replace)
+ {
+ char *to = replace;
+ for (const char *from = str; *from; ++from)
+ {
+ if (*from == '"')
+ {
+ *to = '\\';
+ ++to;
+ }
+ *to = *from;
+ ++to;
+ }
+ *to = '\0';
+ }
+ }
+#endif
+
+ if (allocate_error)
{
- buf[0] = ACE_TEXT ('"');
- ACE_OS::strcpy (buf + 1, ACE_TEXT_CHAR_TO_TCHAR (str));
- ACE_OS::strcat (buf, ACE_TEXT ("\""));
- DRV_arglist[DRV_argcount++] = buf;
+ idl_global->err()->misc_error ("DRV_cpp_putarg failed to allocate memory for argument!");
+ throw Bailout ();
}
}
- else
+
+ DRV_arglist[DRV_argcount++] = ACE::strnew (ACE_TEXT_CHAR_TO_TCHAR (replace ? replace : str));
+
+ if (replace)
{
- DRV_arglist[DRV_argcount++] =
- ACE::strnew (ACE_TEXT_CHAR_TO_TCHAR (str));
+ delete replace;
+ replace = nullptr;
}
}
@@ -587,7 +635,13 @@ DRV_cpp_post_init ()
idl_global->idl_version_.to_macro ());
DRV_cpp_putarg (idl_version_arg);
- DRV_cpp_putarg ("-D__TAO_IDL_FEATURES=\"tao/idl_features.h\"");
+ DRV_cpp_putarg ("-D__TAO_IDL_FEATURES="
+#ifdef TAO_IDL_FEATURES
+ TAO_IDL_FEATURES
+#else
+ "\"tao/idl_features.h\""
+#endif
+ );
// Add include path for TAO_ROOT/orbsvcs.
char* TAO_ROOT = ACE_OS::getenv ("TAO_ROOT");
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
index 39826b3cdcb..b479801e745 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
@@ -139,7 +139,7 @@ TAO_Notify_Tests_Periodic_Consumer::check_priority (const CosNotification::Prope
ACE_TEXT ("TAO (%P|%t) - ")
ACE_TEXT (" ACE_Thread::get_prio\n")));
- return ;
+ return;
}
CORBA::Short native_priority = CORBA::Short (priority);