diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-02-18 22:38:53 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-02-18 22:38:53 +0000 |
commit | 440ddd093aa2747408c2d2d9ec213086ed4ce23f (patch) | |
tree | 3a60641dcd60ebe7435a795b90f366dd65027bdb /ace/ACE.cpp | |
parent | b5d452dcbb47059c57e294823baa0ba466146a4f (diff) | |
download | ATCD-440ddd093aa2747408c2d2d9ec213086ed4ce23f.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/ACE.cpp')
-rw-r--r-- | ace/ACE.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 12f0380e538..b81caac46ea 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -642,21 +642,27 @@ ACE::ldfind (const char filename[], nextholder); int result = 0; - while (path_entry != 0) + for (;;) { - if (ACE_OS::strlen (path_entry) - + 1 + ACE_OS::strlen (searchfilename) >= maxpathnamelen) + // Check if at end of search path. + if (path_entry == 0) + { + errno = ENOENT; + result = -1; + break; + } + else if (ACE_OS::strlen (path_entry) + + 1 + ACE_OS::strlen (searchfilename) >= maxpathnamelen) { errno = ENOMEM; result = -1; break; } - // This works around the issue where a path might have // an empty component indicating 'current directory'. // We need to do it here rather than anywhere else so // that the loop condition will still work. - if (path_entry[0] == '\0') + else if (path_entry[0] == '\0') path_entry = "."; // First, try matching the filename *without* adding a |