From 1468c2e8327918ba5dcf33f121f7fa484c8a02a8 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 29 Feb 2008 09:58:15 +0000 Subject: [PATCH] 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 --- fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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))); -- 2.39.2