mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-28 15:21:57 +00:00
FS_Dir_f little optimisation.
This commit is contained in:
parent
19a119417c
commit
1b7ceada59
1 changed files with 4 additions and 2 deletions
|
@ -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. */
|
||||
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue