making note of my changes.
[oweals/busybox.git] / find.c
diff --git a/find.c b/find.c
index 0f1f5f1891304e2789c77ceb262b750288cdffa9..40a508f051d6b1892985fff5d92a43dc871eebba 100644 (file)
--- a/find.c
+++ b/find.c
@@ -51,8 +51,15 @@ static int fileAction(const char *fileName, struct stat* statbuf)
 {
     if (pattern==NULL)
        fprintf(stdout, "%s\n", fileName);
-    else if (find_match((char*)fileName, pattern, TRUE) == TRUE)
-       fprintf(stdout, "%s\n", fileName);
+    else {
+       char* tmp = strrchr( fileName, '/');
+       if (tmp == NULL)
+           tmp = (char*)fileName;
+       else
+           tmp++;
+       if (check_wildcard_match(tmp, pattern) == TRUE)
+           fprintf(stdout, "%s\n", fileName);
+    }
     return( TRUE);
 }