aboutsummaryrefslogtreecommitdiff
path: root/findutils/find.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-14 14:24:30 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-14 14:24:30 +0000
commit3a6755f56f811f246934f02182531fb1e8ccc72d (patch)
tree3bcbe0186fd69f665ed3634dc2f990f994ec399f /findutils/find.c
parentc345d8e94589e3c74a9fac40f440affbc359c8d1 (diff)
downloadbusybox-w32-3a6755f56f811f246934f02182531fb1e8ccc72d.tar.gz
busybox-w32-3a6755f56f811f246934f02182531fb1e8ccc72d.tar.bz2
busybox-w32-3a6755f56f811f246934f02182531fb1e8ccc72d.zip
grep: add support for -r
Diffstat (limited to 'findutils/find.c')
-rw-r--r--findutils/find.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 913a778eb..62cb5d7eb 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -74,7 +74,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
74 tmp = fileName; 74 tmp = fileName;
75 else 75 else
76 tmp++; 76 tmp++;
77 if (!(fnmatch(pattern, tmp, FNM_PERIOD) == 0)) 77 if (fnmatch(pattern, tmp, FNM_PERIOD) != 0)
78 goto no_match; 78 goto no_match;
79 } 79 }
80#ifdef CONFIG_FEATURE_FIND_TYPE 80#ifdef CONFIG_FEATURE_FIND_TYPE
@@ -143,8 +143,8 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
143#else 143#else
144 puts(fileName); 144 puts(fileName);
145#endif 145#endif
146no_match: 146 no_match:
147 return (TRUE); 147 return TRUE;
148} 148}
149 149
150#ifdef CONFIG_FEATURE_FIND_TYPE 150#ifdef CONFIG_FEATURE_FIND_TYPE
@@ -153,27 +153,27 @@ static int find_type(char *type)
153 int mask = 0; 153 int mask = 0;
154 154
155 switch (type[0]) { 155 switch (type[0]) {
156 case 'b': 156 case 'b':
157 mask = S_IFBLK; 157 mask = S_IFBLK;
158 break; 158 break;
159 case 'c': 159 case 'c':
160 mask = S_IFCHR; 160 mask = S_IFCHR;
161 break; 161 break;
162 case 'd': 162 case 'd':
163 mask = S_IFDIR; 163 mask = S_IFDIR;
164 break; 164 break;
165 case 'p': 165 case 'p':
166 mask = S_IFIFO; 166 mask = S_IFIFO;
167 break; 167 break;
168 case 'f': 168 case 'f':
169 mask = S_IFREG; 169 mask = S_IFREG;
170 break; 170 break;
171 case 'l': 171 case 'l':
172 mask = S_IFLNK; 172 mask = S_IFLNK;
173 break; 173 break;
174 case 's': 174 case 's':
175 mask = S_IFSOCK; 175 mask = S_IFSOCK;
176 break; 176 break;
177 } 177 }
178 178
179 if (mask == 0 || type[1] != '\0') 179 if (mask == 0 || type[1] != '\0')
@@ -306,12 +306,12 @@ int find_main(int argc, char **argv)
306 } 306 }
307 307
308 if (firstopt == 1) { 308 if (firstopt == 1) {
309 if (! recursive_action(".", TRUE, dereference, FALSE, fileAction, 309 if (!recursive_action(".", TRUE, dereference, FALSE, fileAction,
310 fileAction, NULL)) 310 fileAction, NULL))
311 status = EXIT_FAILURE; 311 status = EXIT_FAILURE;
312 } else { 312 } else {
313 for (i = 1; i < firstopt; i++) { 313 for (i = 1; i < firstopt; i++) {
314 if (! recursive_action(argv[i], TRUE, dereference, FALSE, fileAction, 314 if (!recursive_action(argv[i], TRUE, dereference, FALSE, fileAction,
315 fileAction, NULL)) 315 fileAction, NULL))
316 status = EXIT_FAILURE; 316 status = EXIT_FAILURE;
317 } 317 }