]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fixed creating files in root dir (gh#openSUSE/snapper#168) 834/head
authorArvin Schnell <aschnell@suse.de>
Thu, 14 Sep 2023 13:47:22 +0000 (15:47 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 14 Sep 2023 13:47:22 +0000 (15:47 +0200)
LIBVERSION
package/snapper.changes
snapper/File.cc

index 21c8c7b46b8993bd95ff730695cad0d26e4239f3..a8a188756826dae72582b230aa315701fb096149 100644 (file)
@@ -1 +1 @@
-7.1.1
+7.1.2
index efa81bf83c29a56142d1b8dfd038032da55b264b..f50e66795ba8a0f535a7d5d189d681868bb46ba7 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+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
 
index a1b3dbe30ae2b9c9fdca33206c1f4aeb3d245e0e..8a91494fbc66680c56273a0295054aa8eb5de20a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * 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>
@@ -279,7 +279,7 @@ namespace snapper
     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);