aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utility.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 0da98f13d..0ace3eb34 100644
--- a/utility.c
+++ b/utility.c
@@ -715,7 +715,10 @@ int recursive_action(const char *fileName,
return FALSE;
}
memset(nextFile, 0, sizeof(nextFile));
- sprintf(nextFile, "%s/%s", fileName, next->d_name);
+ if (fileName[strlen(fileName)-1] == '/')
+ sprintf(nextFile, "%s%s", fileName, next->d_name);
+ else
+ sprintf(nextFile, "%s/%s", fileName, next->d_name);
status =
recursive_action(nextFile, TRUE, followLinks, depthFirst,
fileAction, dirAction, userData);