diff options
author | Steve Huston <shuston@riverace.com> | 2003-03-04 22:47:16 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2003-03-04 22:47:16 +0000 |
commit | 43204230b511a5a124fd310d0927abfd0ec96727 (patch) | |
tree | c3c1a5a5e5ea5ea4b6a17166d3323dcca4f9aa88 /ace/ACE.cpp | |
parent | ea305f99d79a3afe4097c77e5d5a4e16294fb6f1 (diff) | |
download | ATCD-43204230b511a5a124fd310d0927abfd0ec96727.tar.gz |
ChangeLogTag:Tue Mar 4 17:39:31 2003 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ace/ACE.cpp')
-rw-r--r-- | ace/ACE.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index adea0874652..f1c924305a4 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -254,7 +254,8 @@ const ACE_TCHAR * ACE::execname (const ACE_TCHAR *old_name) { #if defined (ACE_WIN32) - if (ACE_OS::strstr (old_name, ACE_LIB_TEXT (".exe")) == 0) + const ACE_TCHAR *suffix = ACE_OS::strrchr (old_name, ACE_LIB_TEXT ('.')); + if (suffix == 0 || ACE_OS::strcasecmp (suffix, ACE_LIB_TEXT (".exe")) != 0) { ACE_TCHAR *new_name; @@ -271,7 +272,8 @@ ACE::execname (const ACE_TCHAR *old_name) end = ACE_OS::strecpy (new_name, old_name); // Concatenate the .exe suffix onto the end of the executable. - ACE_OS::strcpy (end, ACE_LIB_TEXT (".exe")); + // end points _after_ the terminating nul. + ACE_OS::strcpy (end - 1, ACE_LIB_TEXT (".exe")); return new_name; } |