about summary refs log tree commit diff stats
path: root/rf.c
diff options
context:
space:
mode:
authorRory Bradford <roryrjb@gmail.com>2020-08-11 16:19:49 +0100
committerRory Bradford <roryrjb@gmail.com>2020-08-11 16:19:49 +0100
commit71abce4e0725251ee9484e85fa58e325d1cd6407 (patch)
treebb4994907f4761a4c47570ec10902f419d55f6f0 /rf.c
parentb4f90ecd3cacf7442e693548c13d79137ba1faa0 (diff)
downloadrf-71abce4e0725251ee9484e85fa58e325d1cd6407.tar.gz
Fix double slashes
Signed-off-by: Rory Bradford <roryrjb@gmail.com>
Diffstat (limited to 'rf.c')
-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;