Skip to content

Commit

Permalink
FS_Dir_f little optimisation.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Nov 2, 2024
1 parent 19a1194 commit 1b7cead
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/common/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ FS_Dir_f(void)
char **dirnames; /* File list. */
char findname[1024]; /* File search path and pattern. */
char *path = NULL; /* Search path. */
char *lastsep;
char wildcard[1024] = "*.*"; /* File pattern. */
int i; /* Loop counter. */
int ndirs; /* Number of files in list. */
Expand All @@ -1555,9 +1556,10 @@ FS_Dir_f(void)
{
for (i = 0; i < ndirs - 1; i++)
{
if (strrchr(dirnames[i], '/'))
lastsep = strrchr(dirnames[i], '/');
if (lastsep)
{
Com_Printf("%s\n", strrchr(dirnames[i], '/') + 1);
Com_Printf("%s\n", lastsep + 1);
}
else
{
Expand Down

0 comments on commit 1b7cead

Please sign in to comment.