mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-19 19:54:34 +02:00
Fix unexpected exception in Utility::DirName when specifying an empty path
refs #9263
This commit is contained in:
parent
93b0ab7893
commit
faf0865a94
@ -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