util: Remove virFileSkipRoot()

The function is no longer used since commit faf2d811f3.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Fabiano Fidêncio 2019-12-18 20:40:39 +01:00
parent 25729d6c17
commit ed12b030d4
3 changed files with 0 additions and 56 deletions

View File

@ -2038,7 +2038,6 @@ virFileSanitizePath;
virFileSetACLs;
virFileSetupDev;
virFileSetXAttr;
virFileSkipRoot;
virFileTouch;
virFileUnlock;
virFileUpdatePerm;

View 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.

View 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,