aboutsummaryrefslogtreecommitdiffstats
path: root/src/msec_find/find.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/msec_find/find.c')
-rw-r--r--src/msec_find/find.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/msec_find/find.c b/src/msec_find/find.c
index 490e41d..294881e 100644
--- a/src/msec_find/find.c
+++ b/src/msec_find/find.c
@@ -198,10 +198,13 @@ int main(int argc, char **argv)
strcpy(directory, argv[i]);
strcat(directory, "/");
- } else directory = argv[i];
-
- res = nftw(directory, traverse, 200, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
- if ( ctrl ) {
+ } else {
+ directory = argv[i];
+ }
+
+ res = nftw(directory, traverse, 200, FTW_PHYS | FTW_MOUNT);
+
+ if ( ctrl ) {
free(directory);
ctrl = 0;
}