mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 04:34:43 +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
|
#ifndef _WIN32
|
||||||
result = dirname(dir);
|
result = dirname(dir);
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
if (!PathRemoveFileSpec(dir)) {
|
if (dir[0] != 0 && !PathRemoveFileSpec(dir)) {
|
||||||
free(dir);
|
free(dir);
|
||||||
|
|
||||||
BOOST_THROW_EXCEPTION(win32_error()
|
BOOST_THROW_EXCEPTION(win32_error()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user