From: havoc Date: Fri, 29 Feb 2008 09:58:15 +0000 (+0000) Subject: a fix from Black for prevseparator, hopefully the only bug X-Git-Tag: xonotic-v0.1.0preview~2363 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1468c2e8327918ba5dcf33f121f7fa484c8a02a8;p=xonotic%2Fdarkplaces.git a fix from Black for prevseparator, hopefully the only bug git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8160 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/fs.c b/fs.c index 3e3820ed..4b06a4e7 100644 --- a/fs.c +++ b/fs.c @@ -2633,11 +2633,11 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet) // copy everything up except nextseperator strlcpy(subpattern, pattern, min(sizeof(subpattern), (size_t) (nextseparator - pattern + 1))); // find the last '/' before the wildcard - prevseparator = strrchr( subpattern, '/' ) + 1; + prevseparator = strrchr( subpattern, '/' ); if (!prevseparator) - { prevseparator = subpattern; - } + else + prevseparator++; // copy everything from start to the previous including the '/' (before the wildcard) // everything up to start is already included in the path of matchedSet's entries strlcpy(subpath, start, min(sizeof(subpath), (size_t) ((prevseparator - subpattern) - (start - pattern) + 1)));