mirror of https://github.com/Icinga/icinga2.git
Fix unexpected exception in Utility::DirName when specifying an empty path
refs #9263
This commit is contained in:
parent
a0f7aa4fe6
commit
cfcb8675c7
|
@ -175,7 +175,7 @@ String Utility::DirName(const String& path)
|
|||
#ifndef _WIN32
|
||||
result = dirname(dir);
|
||||
#else /* _WIN32 */
|
||||
if (!PathRemoveFileSpec(dir)) {
|
||||
if (dir[0] != 0 && !PathRemoveFileSpec(dir)) {
|
||||
free(dir);
|
||||
|
||||
BOOST_THROW_EXCEPTION(win32_error()
|
||||
|
|
Loading…
Reference in New Issue