From 71abce4e0725251ee9484e85fa58e325d1cd6407 Mon Sep 17 00:00:00 2001 From: Rory Bradford Date: Tue, 11 Aug 2020 16:19:49 +0100 Subject: Fix double slashes Signed-off-by: Rory Bradford --- rf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rf.c') 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; -- cgit 1.4.1-2-gfad0 e='953e3cc1204cde0f59c0d1230694b5ad5682c698'>this commit Profanity fork with TTY improvementsdanisanti <danisanti@tilde.institute>
about summary refs log tree commit diff stats
blob: 34e4ba45644e1f0d21666684a65ba2e27c2574f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11