diff options
author | Rory Bradford <roryrjb@gmail.com> | 2020-08-11 16:19:49 +0100 |
---|---|---|
committer | Rory Bradford <roryrjb@gmail.com> | 2020-08-11 16:19:49 +0100 |
commit | 71abce4e0725251ee9484e85fa58e325d1cd6407 (patch) | |
tree | bb4994907f4761a4c47570ec10902f419d55f6f0 /rf.c | |
parent | b4f90ecd3cacf7442e693548c13d79137ba1faa0 (diff) | |
download | rf-71abce4e0725251ee9484e85fa58e325d1cd6407.tar.gz |
Fix double slashes
Signed-off-by: Rory Bradford <roryrjb@gmail.com>
Diffstat (limited to 'rf.c')
-rw-r--r-- | rf.c | 6 |
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; |