From a124054f11272da65ab027050bf886cdd46873ae Mon Sep 17 00:00:00 2001 From: schmidt Date: Thu, 19 Aug 1999 18:04:16 +0000 Subject: ChangeLogTag:Thu Aug 19 13:03:07 1999 Douglas C. Schmidt --- ChangeLog-99b | 6 ++++++ ace/ACE.cpp | 7 ++----- ace/ACE.h | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog-99b b/ChangeLog-99b index ec3eb472146..f248ad051be 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,9 @@ +Thu Aug 19 13:03:07 1999 Douglas C. Schmidt + + * ace/ACE.cpp: Fixed a bug in ACE::dirname() that was causing problems + if the pathname didn't have a delim character. Thanks to Russ + Noseworthy for reporting this and providing a fix. + Thu Aug 19 12:59:56 1999 Carlos O'Ryan * ace/Message_Block.i: diff --git a/ace/ACE.cpp b/ace/ACE.cpp index bb354e25ef8..83a44988050 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -1032,11 +1032,8 @@ ACE::dirname (const char *pathname, char delim) if (temp == 0) { - if (ACE_OS::strcmp (pathname, ".") == 0 - || ACE_OS::strcmp (pathname, "..") == 0) - return_dirname[0] = '.'; - else - return_dirname[0] = delim; + return_dirname[0] = '.'; + return_dirname[1] = '\0'; return return_dirname; } diff --git a/ace/ACE.h b/ace/ACE.h index f28e1f6745f..e291bceca8a 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -506,8 +506,9 @@ public: static const char *dirname (const char *pathname, char delim = ACE_DIRECTORY_SEPARATOR_CHAR_A); // Returns the "dirname" of a . For instance, the - // basename of "/tmp/foo.cpp" is "/tmp" when is '/'. This - // method does not modify and is not reentrant. + // basename of "/tmp/foo.cpp" is "/tmp" when is '/'. If + // has no ".\0" is returned. This method does + // not modify and is not reentrant. #if defined (ACE_HAS_UNICODE) // A collection of wide string functions. See above for details. -- cgit v1.2.1