Virtual ISO: Use the actual basename function and remove the legacy one
This commit is contained in:
@@ -902,7 +902,7 @@ next_dir:
|
|||||||
tz_offset = (now - mktime(gmtime(&now))) / (3600 / 4);
|
tz_offset = (now - mktime(gmtime(&now))) / (3600 / 4);
|
||||||
|
|
||||||
/* Get root directory basename for the volume ID. */
|
/* Get root directory basename for the volume ID. */
|
||||||
char *basename = plat_get_basename(dirname);
|
char *basename = path_get_filename(viso->root_dir->path);
|
||||||
if (!basename || (basename[0] == '\0'))
|
if (!basename || (basename[0] == '\0'))
|
||||||
basename = EMU_NAME;
|
basename = EMU_NAME;
|
||||||
|
|
||||||
|
@@ -194,13 +194,6 @@ plat_getcwd(char *bufp, int max)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
plat_get_basename(const char *path)
|
|
||||||
{
|
|
||||||
QFileInfo fi(path);
|
|
||||||
return fi.fileName().toUtf8().data();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
path_get_dirname(char *dest, const char *path)
|
path_get_dirname(char *dest, const char *path)
|
||||||
{
|
{
|
||||||
|
@@ -326,19 +326,6 @@ plat_put_backslash(char *s)
|
|||||||
|
|
||||||
/* Return the last element of a pathname. */
|
/* Return the last element of a pathname. */
|
||||||
char *
|
char *
|
||||||
plat_get_basename(const char *path)
|
|
||||||
{
|
|
||||||
int c = (int)strlen(path);
|
|
||||||
|
|
||||||
while (c > 0) {
|
|
||||||
if (path[c] == '/')
|
|
||||||
return((char *)&path[c + 1]);
|
|
||||||
c--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return((char *)path);
|
|
||||||
}
|
|
||||||
char *
|
|
||||||
path_get_filename(char *s)
|
path_get_filename(char *s)
|
||||||
{
|
{
|
||||||
int c = strlen(s) - 1;
|
int c = strlen(s) - 1;
|
||||||
|
@@ -764,22 +764,6 @@ path_abs(char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Return the last element of a pathname. */
|
|
||||||
char *
|
|
||||||
plat_get_basename(const char *path)
|
|
||||||
{
|
|
||||||
int c = (int)strlen(path);
|
|
||||||
|
|
||||||
while (c > 0) {
|
|
||||||
if (path[c] == '/' || path[c] == '\\')
|
|
||||||
return((char *)&path[c + 1]);
|
|
||||||
c--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return((char *)path);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Return the 'directory' element of a pathname. */
|
/* Return the 'directory' element of a pathname. */
|
||||||
void
|
void
|
||||||
path_get_dirname(char *dest, const char *path)
|
path_get_dirname(char *dest, const char *path)
|
||||||
|
Reference in New Issue
Block a user