mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
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…
x
Reference in New Issue
Block a user