diff options
author | Adam Mitz <mitza-oci@users.noreply.github.com> | 2009-06-16 15:17:31 +0000 |
---|---|---|
committer | Adam Mitz <mitza-oci@users.noreply.github.com> | 2009-06-16 15:17:31 +0000 |
commit | 976a8e49da4ac2a9e332504292af77763c75a6b1 (patch) | |
tree | e11555ef1d69b3e6a588aff3195bc072a0114ad0 | |
parent | e1b7cd610913f6404b5a0766e3e23311d1cb4f81 (diff) | |
download | ATCD-976a8e49da4ac2a9e332504292af77763c75a6b1.tar.gz |
ChangeLogTag: Tue Jun 16 15:14:52 UTC 2009 Adam Mitz <mitza@ociweb.com>
-rw-r--r-- | ACE/ChangeLog | 9 | ||||
-rw-r--r-- | 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 <mitza@ociweb.com> + + * 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 <jwillemsen@remedy.nl> * tests/Bug_3673_Regression_Test.cpp: @@ -17,7 +24,7 @@ Fri Jun 12 19:05:43 UTC 2009 Adam Mitz <mitza@ociweb.com> Fri Jun 12 19:16:04 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> - 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 { |