Skip to content

Commit

Permalink
Don't return a slash at the end for directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
smallmodel committed Dec 2, 2024
1 parent 861338b commit 719cc75
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions code/qcommon/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 719cc75

Please sign in to comment.