diff options
-rw-r--r-- | shell/match.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/shell/match.c b/shell/match.c index e77c5d732..fee3cf2a8 100644 --- a/shell/match.c +++ b/shell/match.c | |||
@@ -27,8 +27,6 @@ | |||
27 | #include <fnmatch.h> | 27 | #include <fnmatch.h> |
28 | #include "match.h" | 28 | #include "match.h" |
29 | 29 | ||
30 | #define pmatch(a, b) !fnmatch((a), (b), 0) | ||
31 | |||
32 | char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags) | 30 | char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags) |
33 | { | 31 | { |
34 | char *loc; | 32 | char *loc; |
@@ -67,17 +65,17 @@ char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags | |||
67 | 65 | ||
68 | while (loc != end) { | 66 | while (loc != end) { |
69 | char c; | 67 | char c; |
70 | int match; | 68 | int r; |
71 | 69 | ||
72 | c = *loc; | 70 | c = *loc; |
73 | if (flags & SCAN_MATCH_LEFT_HALF) { | 71 | if (flags & SCAN_MATCH_LEFT_HALF) { |
74 | *loc = '\0'; | 72 | *loc = '\0'; |
75 | match = pmatch(pattern, string); | 73 | r = fnmatch(pattern, string, 0); |
76 | *loc = c; | 74 | *loc = c; |
77 | } else { | 75 | } else { |
78 | match = pmatch(pattern, loc); | 76 | r = fnmatch(pattern, loc, 0); |
79 | } | 77 | } |
80 | if (match) | 78 | if (r == 0) /* match found */ |
81 | return loc; | 79 | return loc; |
82 | if (early_exit) { | 80 | if (early_exit) { |
83 | #ifdef STANDALONE | 81 | #ifdef STANDALONE |