diff options
Diffstat (limited to 'src/core/wee-util.c')
-rw-r--r-- | src/core/wee-util.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/wee-util.c b/src/core/wee-util.c index e737c7592..86f5f6b93 100644 --- a/src/core/wee-util.c +++ b/src/core/wee-util.c @@ -152,13 +152,17 @@ util_create_dir (char *directory, int permissions) */ void -util_exec_on_files (char *directory, int (*callback)(char *)) +util_exec_on_files (char *directory, void *data, + int (*callback)(void *data, char *filename)) { char complete_filename[1024]; DIR *dir; struct dirent *entry; struct stat statbuf; + if (!directory || !callback) + return; + dir = opendir (directory); if (dir) { @@ -169,7 +173,7 @@ util_exec_on_files (char *directory, int (*callback)(char *)) lstat (complete_filename, &statbuf); if (!S_ISDIR(statbuf.st_mode)) { - (int) (*callback) (complete_filename); + (int) (*callback) (data, complete_filename); } } closedir (dir); |