+ /* If the pattern does not have any slashes AND it does not have
+ * a "**" (which could match a slash), then we just match the
+ * name portion of the path. */
+ if (!ex->slash_cnt && !(ex->match_flags & MATCHFLG_WILD2)) {
+ if ((p = strrchr(name,'/')) != NULL)
+ name = p+1;
+ }
+ else if ((ex->match_flags & MATCHFLG_ABS_PATH) && *name != '/') {
+ static char full_name[MAXPATHLEN];
+ extern char curr_dir[];
+ int plus = curr_dir[1] == '\0'? 1 : 0;
+ snprintf(full_name, sizeof full_name,
+ "%s/%s", curr_dir+plus, name);
+ name = full_name;
+ }