Don't return a slash at the end for directory name

This commit is contained in:
smallmodel 2024-12-02 21:08:42 +01:00 committed by GitHub
parent 861338b0fc
commit f7c8c745c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2448,16 +2448,17 @@ char **FS_ListFilteredFiles( const char *path, const char *extension, const char
}
// unique the match
temp = pathLength;
if (pathLength) {
temp++; // include the '/'
}
if (bDirSearch) {
strcpy(zpath, name + pathLength);
zpath[length - pathLength - 1] = 0;
strcpy(zpath, name + temp);
zpath[length - temp - 1] = 0;
nfiles = FS_AddFileToList(zpath, list, nfiles);
}
else {
temp = pathLength;
if (pathLength) {
temp++; // include the '/'
}
nfiles = FS_AddFileToList(name + temp, list, nfiles);
}
}