aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-03-17 23:39:17 +0100
committerBert <ber.t@gmx.com>2011-03-17 23:39:17 +0100
commit87a982841757da100993839b9c0002c2548838bc (patch)
treead2886226680ad2f9a2ec5736885bb59594e0d22 /main.c
parent55659ffcc38d547b2a1525b9e444ae9ec8394643 (diff)
Filename cosmetics
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index 558980e..95857a9 100644
--- a/main.c
+++ b/main.c
@@ -246,7 +246,8 @@ void read_dir_rec(const char *dirname) {
len = strlen(dirname) + strlen(dentry->d_name) + 2;
filename = (char*) s_malloc(len * sizeof(char));
- snprintf(filename, len, "%s/%s", dirname, dentry->d_name);
+ snprintf(filename, len, "%s%s%s", dirname,
+ dirname[strlen(dirname)-1] == '/' ? "" : "/", dentry->d_name);
if (!stat(filename, &fstats) && S_ISDIR(fstats.st_mode)) {
if (diridx == dircnt) {