Fix something Ive broken ofc.
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Feb 2008 20:41:07 +0000 (20:41 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Feb 2008 20:41:07 +0000 (20:41 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8093 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index ad6e55b..648b786 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -2596,6 +2596,7 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet)
                }
                else
                {
+                       int searchpathlen = strlen( searchpath->filename );
                        // get a directory listing and look at each name
                        dpsnprintf(netpath, sizeof (netpath), "%s%s", searchpath->filename, basepath);
                        stringlistinit(&dirlist);
@@ -2603,7 +2604,7 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet)
                        for (dirlistindex = 0;dirlistindex < dirlist.numstrings;dirlistindex++)
                        {
                                const char *direntry = dirlist.strings[dirlistindex];
-                               if (matchpattern(direntry, (char *)pattern, true))
+                               if (matchpattern(direntry + searchpathlen, (char *)pattern, true))
                                {
                                        for (resultlistindex = 0;resultlistindex < resultlist.numstrings;resultlistindex++)
                                                if (!strcmp(resultlist.strings[resultlistindex], direntry))