Some fixes and such
diff --git a/utility.c b/utility.c
index cf90f37..4bb479f 100644
--- a/utility.c
+++ b/utility.c
@@ -46,8 +46,9 @@
if (stat(name, &statBuf) < 0)
return FALSE;
-
- return S_ISDIR(statBuf.st_mode);
+ if (S_ISDIR(statBuf.st_mode))
+ return TRUE;
+ return(FALSE);
}
@@ -467,8 +468,8 @@
*/
int
recursiveAction(const char *fileName, int recurse, int followLinks,
- int (*fileAction) (const char *fileName),
- int (*dirAction) (const char *fileName))
+ int (*fileAction) (const char *fileName, struct stat* statbuf),
+ int (*dirAction) (const char *fileName, struct stat* statbuf))
{
int status;
struct stat statbuf;
@@ -487,7 +488,7 @@
if (recurse == FALSE) {
if (S_ISDIR(statbuf.st_mode)) {
if (dirAction != NULL)
- return (dirAction(fileName));
+ return (dirAction(fileName, &statbuf));
else
return (TRUE);
}
@@ -501,7 +502,7 @@
return (FALSE);
}
if (dirAction != NULL) {
- status = dirAction(fileName);
+ status = dirAction(fileName, &statbuf);
if (status == FALSE) {
perror(fileName);
return (FALSE);
@@ -531,7 +532,7 @@
if (fileAction == NULL)
return (TRUE);
else
- return (fileAction(fileName));
+ return (fileAction(fileName, &statbuf));
}
return (TRUE);
}