about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--rf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rf.c b/rf.c
index 14acc9d..6fc4981 100644
--- a/rf.c
+++ b/rf.c
@@ -102,7 +102,11 @@ static int recurse_find(char **patterns, int *pattern_count, char *dirname,
 
 			char full_path[MAXPATHLEN] = {'\0'};
 			strcat(full_path, path);
-			strcat(full_path, "/");
+
+			if (full_path[strlen(full_path) - 1] != '/') {
+				strcat(full_path, "/");
+			}
+
 			strcat(full_path, entry->d_name);
 
 			struct stat entry_stat;