]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Remove virFileSkipRoot()
authorFabiano Fidêncio <fidencio@redhat.com>
Wed, 18 Dec 2019 19:40:39 +0000 (20:40 +0100)
committerFabiano Fidêncio <fidencio@redhat.com>
Wed, 18 Dec 2019 22:11:50 +0000 (23:11 +0100)
The function is no longer used since commit faf2d811f3e9a4.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/libvirt_private.syms
src/util/virfile.c
src/util/virfile.h

index 9852f5d4a60d8789fef7950017127fffba1c0486..797c15bb42ab6f3f1020568caa9734fd93f15d72 100644 (file)
@@ -2038,7 +2038,6 @@ virFileSanitizePath;
 virFileSetACLs;
 virFileSetupDev;
 virFileSetXAttr;
-virFileSkipRoot;
 virFileTouch;
 virFileUnlock;
 virFileUpdatePerm;
index 4fd865dd83988459cd93383787147dfe50cf1ea7..624bd9e3d02541430301b480f27a64a0b857ec08 100644 (file)
@@ -3197,60 +3197,6 @@ virFileIsAbsPath(const char *path)
     return false;
 }
 
-
-const char *
-virFileSkipRoot(const char *path)
-{
-#ifdef WIN32
-    /* Skip \\server\share or //server/share */
-    if (VIR_FILE_IS_DIR_SEPARATOR(path[0]) &&
-        VIR_FILE_IS_DIR_SEPARATOR(path[1]) &&
-        path[2] &&
-        !VIR_FILE_IS_DIR_SEPARATOR(path[2]))
-    {
-        const char *p = strchr(path + 2, VIR_FILE_DIR_SEPARATOR);
-        const char *q = strchr(path + 2, '/');
-
-        if (p == NULL || (q != NULL && q < p))
-            p = q;
-
-        if (p && p > path + 2 && p[1]) {
-            path = p + 1;
-
-            while (path[0] &&
-                   !VIR_FILE_IS_DIR_SEPARATOR(path[0]))
-                path++;
-
-            /* Possibly skip a backslash after the share name */
-            if (VIR_FILE_IS_DIR_SEPARATOR(path[0]))
-                path++;
-
-            return path;
-        }
-    }
-#endif
-
-    /* Skip initial slashes */
-    if (VIR_FILE_IS_DIR_SEPARATOR(path[0])) {
-        while (VIR_FILE_IS_DIR_SEPARATOR(path[0]))
-            path++;
-
-        return path;
-    }
-
-#ifdef WIN32
-    /* Skip X:\ */
-    if (g_ascii_isalpha(path[0]) &&
-        path[1] == ':' &&
-        VIR_FILE_IS_DIR_SEPARATOR(path[2]))
-        return path + 3;
-#endif
-
-    return path;
-}
-
-
-
 /*
  * Creates an absolute path for a potentially relative path.
  * Return 0 if the path was not relative, or on success.
index bcae40ee06d66146835010e6341ea75e8e305405..80641f763ad9139fec241786359ecd2da217bdd0 100644 (file)
@@ -302,7 +302,6 @@ char *virFileBuildPath(const char *dir,
 bool virFileIsAbsPath(const char *path);
 int virFileAbsPath(const char *path,
                    char **abspath) G_GNUC_WARN_UNUSED_RESULT;
-const char *virFileSkipRoot(const char *path);
 void virFileRemoveLastComponent(char *path);
 
 int virFileOpenTty(int *ttymaster,