From 976a8e49da4ac2a9e332504292af77763c75a6b1 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Tue, 16 Jun 2009 15:17:31 +0000 Subject: ChangeLogTag: Tue Jun 16 15:14:52 UTC 2009 Adam Mitz --- ACE/ChangeLog | 9 ++++++++- ACE/ace/OS_main.cpp | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 13484030e90..04289b06b3b 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,10 @@ +Tue Jun 16 15:14:52 UTC 2009 Adam Mitz + + * ace/OS_main.cpp: + + For Windows CE/Mobile: when constructing argv[0], quote the full + path to the exe if it contains spaces (\Program Files\...). + Mon Jun 15 07:45:04 UTC 2009 Johnny Willemsen * tests/Bug_3673_Regression_Test.cpp: @@ -17,7 +24,7 @@ Fri Jun 12 19:05:43 UTC 2009 Adam Mitz Fri Jun 12 19:16:04 UTC 2009 Johnny Willemsen - Rever the change below, Adam has a better fix + Revert the change below, Adam has a better fix * ace/config-WinCE.h Set ACE_LACKS_SO_RCVBUF for WinCE 5, it is not supported diff --git a/ACE/ace/OS_main.cpp b/ACE/ace/OS_main.cpp index dc5728b2184..e12f70ab46d 100644 --- a/ACE/ace/OS_main.cpp +++ b/ACE/ace/OS_main.cpp @@ -103,6 +103,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL // CE only gets a command line string; no argv. So we need to convert it // when the main entrypoint expects argc/argv. ACE_ARGV supports this. # include "ace/OS_NS_string.h" +# include "ace/OS_NS_ctype.h" # include "ace/ACE.h" # include "ace/ARGV.h" @@ -121,8 +122,18 @@ int ACE_Main_Base::run (HINSTANCE, ACE_TCHAR msg_file [MAXPATHLEN]; if (ACE_TEXT_GetModuleFileName (0, msg_file, MAXPATHLEN)) { - ACE_OS::strcpy (cmdline, msg_file); - ACE_OS::strcat (cmdline, ACE_TEXT (" ")); + bool quote = false; + for (size_t i(0); !quote && msg_file[i]; ++i) + { + if (ACE_OS::ace_isspace (msg_file[i])) quote = true; + } + ACE_TCHAR *cmd_iter = cmdline; + if (quote) + { + *cmd_iter++ = ACE_TEXT ('"'); + } + ACE_OS::strcpy (cmd_iter, msg_file); + ACE_OS::strcat (cmd_iter, quote ? ACE_TEXT ("\" ") : ACE_TEXT (" ")); } else { -- cgit v1.2.1