a fix from Black for prevseparator, hopefully the only bug
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 29 Feb 2008 09:58:15 +0000 (09:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 29 Feb 2008 09:58:15 +0000 (09:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8160 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index 3e3820e..4b06a4e 100644 (file)
--- 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)));