+-------------------------------------------------------------------
+Thu Sep 14 15:45:53 CEST 2023 - aschnell@suse.com
+
+- fixed creating files in root dir (gh#openSUSE/snapper#168)
+
-------------------------------------------------------------------
Thu Aug 10 09:20:42 CEST 2023 - aschnell@suse.com
/*
* Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) 2022 SUSE LLC
+ * Copyright (c) [2022-2023] SUSE LLC
*
* All Rights Reserved.
*
#include <sys/stat.h>
#include <sys/types.h>
-#include <string.h>
+#include <cstring>
#include <unistd.h>
#include <fnmatch.h>
-#include <errno.h>
+#include <cerrno>
#include <fcntl.h>
#include <locale>
#include <boost/algorithm/string.hpp>
File::createParentDirectories(const string& path) const
{
string::size_type pos = path.rfind('/');
- if (pos == string::npos)
+ if (pos == 0 || pos == string::npos)
return true;
const string& leading_path = path.substr(0, pos);