aboutsummaryrefslogtreecommitdiff
path: root/libbb/recursive_action.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-12-20 23:13:26 +0000
committerMatt Kraai <kraai@debian.org>2001-12-20 23:13:26 +0000
commit1f0c43668ac332cbcf61cbdf71844799327cc8b9 (patch)
tree97414e991363fa613f229019d697280cae1097e0 /libbb/recursive_action.c
parent31c73af656813b5cadcb1dd27adb9bbc62a98987 (diff)
downloadbusybox-w32-1f0c43668ac332cbcf61cbdf71844799327cc8b9.tar.gz
busybox-w32-1f0c43668ac332cbcf61cbdf71844799327cc8b9.tar.bz2
busybox-w32-1f0c43668ac332cbcf61cbdf71844799327cc8b9.zip
Remove `== TRUE' tests and convert `!= TRUE' and `== FALSE' tests to use !.
Diffstat (limited to 'libbb/recursive_action.c')
-rw-r--r--libbb/recursive_action.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index e87ab9860..8917f470f 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -53,7 +53,7 @@ int recursive_action(const char *fileName,
53 struct stat statbuf; 53 struct stat statbuf;
54 struct dirent *next; 54 struct dirent *next;
55 55
56 if (followLinks == TRUE) 56 if (followLinks)
57 status = stat(fileName, &statbuf); 57 status = stat(fileName, &statbuf);
58 else 58 else
59 status = lstat(fileName, &statbuf); 59 status = lstat(fileName, &statbuf);
@@ -68,14 +68,14 @@ int recursive_action(const char *fileName,
68 return FALSE; 68 return FALSE;
69 } 69 }
70 70
71 if ((followLinks == FALSE) && (S_ISLNK(statbuf.st_mode))) { 71 if (! followLinks && (S_ISLNK(statbuf.st_mode))) {
72 if (fileAction == NULL) 72 if (fileAction == NULL)
73 return TRUE; 73 return TRUE;
74 else 74 else
75 return fileAction(fileName, &statbuf, userData); 75 return fileAction(fileName, &statbuf, userData);
76 } 76 }
77 77
78 if (recurse == FALSE) { 78 if (! recurse) {
79 if (S_ISDIR(statbuf.st_mode)) { 79 if (S_ISDIR(statbuf.st_mode)) {
80 if (dirAction != NULL) 80 if (dirAction != NULL)
81 return (dirAction(fileName, &statbuf, userData)); 81 return (dirAction(fileName, &statbuf, userData));
@@ -87,9 +87,9 @@ int recursive_action(const char *fileName,
87 if (S_ISDIR(statbuf.st_mode)) { 87 if (S_ISDIR(statbuf.st_mode)) {
88 DIR *dir; 88 DIR *dir;
89 89
90 if (dirAction != NULL && depthFirst == FALSE) { 90 if (dirAction != NULL && ! depthFirst) {
91 status = dirAction(fileName, &statbuf, userData); 91 status = dirAction(fileName, &statbuf, userData);
92 if (status == FALSE) { 92 if (! status) {
93 perror_msg("%s", fileName); 93 perror_msg("%s", fileName);
94 return FALSE; 94 return FALSE;
95 } else if (status == SKIP) 95 } else if (status == SKIP)
@@ -109,20 +109,20 @@ int recursive_action(const char *fileName,
109 continue; 109 continue;
110 } 110 }
111 nextFile = concat_path_file(fileName, next->d_name); 111 nextFile = concat_path_file(fileName, next->d_name);
112 if (recursive_action(nextFile, TRUE, followLinks, depthFirst, 112 if (! recursive_action(nextFile, TRUE, followLinks, depthFirst,
113 fileAction, dirAction, userData) == FALSE) { 113 fileAction, dirAction, userData)) {
114 status = FALSE; 114 status = FALSE;
115 } 115 }
116 free(nextFile); 116 free(nextFile);
117 } 117 }
118 closedir(dir); 118 closedir(dir);
119 if (dirAction != NULL && depthFirst == TRUE) { 119 if (dirAction != NULL && depthFirst) {
120 if (dirAction(fileName, &statbuf, userData) == FALSE) { 120 if (! dirAction(fileName, &statbuf, userData)) {
121 perror_msg("%s", fileName); 121 perror_msg("%s", fileName);
122 return FALSE; 122 return FALSE;
123 } 123 }
124 } 124 }
125 if (status == FALSE) 125 if (! status)
126 return FALSE; 126 return FALSE;
127 } else { 127 } else {
128 if (fileAction == NULL) 128 if (fileAction == NULL)