]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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 3e3820ed1c249705f3ad516fb86f4601de076b5f..4b06a4e772ae3a7a15be76687a7d6f7c6ea5091c 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)));