提交 ed12b030 编写于 作者: F Fabiano Fidêncio

util: Remove virFileSkipRoot()

The function is no longer used since commit faf2d811.
Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 25729d6c
...@@ -2038,7 +2038,6 @@ virFileSanitizePath; ...@@ -2038,7 +2038,6 @@ virFileSanitizePath;
virFileSetACLs; virFileSetACLs;
virFileSetupDev; virFileSetupDev;
virFileSetXAttr; virFileSetXAttr;
virFileSkipRoot;
virFileTouch; virFileTouch;
virFileUnlock; virFileUnlock;
virFileUpdatePerm; virFileUpdatePerm;
......
...@@ -3197,60 +3197,6 @@ virFileIsAbsPath(const char *path) ...@@ -3197,60 +3197,6 @@ virFileIsAbsPath(const char *path)
return false; 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. * Creates an absolute path for a potentially relative path.
* Return 0 if the path was not relative, or on success. * Return 0 if the path was not relative, or on success.
......
...@@ -302,7 +302,6 @@ char *virFileBuildPath(const char *dir, ...@@ -302,7 +302,6 @@ char *virFileBuildPath(const char *dir,
bool virFileIsAbsPath(const char *path); bool virFileIsAbsPath(const char *path);
int virFileAbsPath(const char *path, int virFileAbsPath(const char *path,
char **abspath) G_GNUC_WARN_UNUSED_RESULT; char **abspath) G_GNUC_WARN_UNUSED_RESULT;
const char *virFileSkipRoot(const char *path);
void virFileRemoveLastComponent(char *path); void virFileRemoveLastComponent(char *path);
int virFileOpenTty(int *ttymaster, int virFileOpenTty(int *ttymaster,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册