}
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);
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))