aboutsummaryrefslogtreecommitdiff
path: root/libbb/recursive_action.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 /libbb/recursive_action.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 'libbb/recursive_action.c')
-rw-r--r--libbb/recursive_action.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index 28a493403..6949e34f3 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -46,14 +46,14 @@ int recursive_action(const char *fileName,
46 return FALSE; 46 return FALSE;
47 } 47 }
48 48
49 if (! followLinks && (S_ISLNK(statbuf.st_mode))) { 49 if (!followLinks && (S_ISLNK(statbuf.st_mode))) {
50 if (fileAction == NULL) 50 if (fileAction == NULL)
51 return TRUE; 51 return TRUE;
52 else 52 else
53 return fileAction(fileName, &statbuf, userData); 53 return fileAction(fileName, &statbuf, userData);
54 } 54 }
55 55
56 if (! recurse) { 56 if (!recurse) {
57 if (S_ISDIR(statbuf.st_mode)) { 57 if (S_ISDIR(statbuf.st_mode)) {
58 if (dirAction != NULL) 58 if (dirAction != NULL)
59 return (dirAction(fileName, &statbuf, userData)); 59 return (dirAction(fileName, &statbuf, userData));
@@ -65,9 +65,9 @@ int recursive_action(const char *fileName,
65 if (S_ISDIR(statbuf.st_mode)) { 65 if (S_ISDIR(statbuf.st_mode)) {
66 DIR *dir; 66 DIR *dir;
67 67
68 if (dirAction != NULL && ! depthFirst) { 68 if (dirAction != NULL && !depthFirst) {
69 status = dirAction(fileName, &statbuf, userData); 69 status = dirAction(fileName, &statbuf, userData);
70 if (! status) { 70 if (!status) {
71 bb_perror_msg("%s", fileName); 71 bb_perror_msg("%s", fileName);
72 return FALSE; 72 return FALSE;
73 } else if (status == SKIP) 73 } else if (status == SKIP)
@@ -84,7 +84,7 @@ int recursive_action(const char *fileName,
84 nextFile = concat_subpath_file(fileName, next->d_name); 84 nextFile = concat_subpath_file(fileName, next->d_name);
85 if(nextFile == NULL) 85 if(nextFile == NULL)
86 continue; 86 continue;
87 if (! recursive_action(nextFile, TRUE, followLinks, depthFirst, 87 if (!recursive_action(nextFile, TRUE, followLinks, depthFirst,
88 fileAction, dirAction, userData)) { 88 fileAction, dirAction, userData)) {
89 status = FALSE; 89 status = FALSE;
90 } 90 }
@@ -92,12 +92,12 @@ int recursive_action(const char *fileName,
92 } 92 }
93 closedir(dir); 93 closedir(dir);
94 if (dirAction != NULL && depthFirst) { 94 if (dirAction != NULL && depthFirst) {
95 if (! dirAction(fileName, &statbuf, userData)) { 95 if (!dirAction(fileName, &statbuf, userData)) {
96 bb_perror_msg("%s", fileName); 96 bb_perror_msg("%s", fileName);
97 return FALSE; 97 return FALSE;
98 } 98 }
99 } 99 }
100 if (! status) 100 if (!status)
101 return FALSE; 101 return FALSE;
102 } else { 102 } else {
103 if (fileAction == NULL) 103 if (fileAction == NULL)