diff options
author | Bert <ber.t@gmx.com> | 2011-03-17 23:39:17 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-03-17 23:39:17 +0100 |
commit | 87a982841757da100993839b9c0002c2548838bc (patch) | |
tree | ad2886226680ad2f9a2ec5736885bb59594e0d22 | |
parent | 55659ffcc38d547b2a1525b9e444ae9ec8394643 (diff) |
Filename cosmetics
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | main.c | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -1,6 +1,6 @@ all: sxiv -VERSION=git-20110315 +VERSION=git-20110317 CC?=gcc PREFIX?=/usr/local @@ -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) { |