diff options
author | waker <wakeroid@gmail.com> | 2011-01-02 12:02:27 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-01-02 12:02:27 +0100 |
commit | e8ed8a04ba8a31ad7734524dba40b02aabcd67eb (patch) | |
tree | fef6a291d0748e665717408f67689db76aaf5cd7 /plugins/artwork | |
parent | 1f87b4b17b4ba342a0960fa1e8e69fa098245151 (diff) |
fixed artwork cache path regression
Diffstat (limited to 'plugins/artwork')
-rw-r--r-- | plugins/artwork/artwork.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index f9067dd7..b8258957 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -56,11 +56,11 @@ static const char *get_default_cover (void) { int make_cache_dir_path (char *path, int size, const char *artist) { const char *cache = getenv ("XDG_CACHE_HOME"); + int sz = snprintf (path, size, "%s/deadbeef/", cache ? cache : getenv ("HOME")); - size -= sz; path += sz; - sz = snprintf (path, size, "%s", artist); + sz += snprintf (path, size-sz, "%s", artist); for (char *p = path; *p; p++) { if (*p == '/') { *p = '_'; @@ -71,6 +71,7 @@ make_cache_dir_path (char *path, int size, const char *artist) { void make_cache_path (char *path, int size, const char *album, const char *artist) { + char *p = path; int sz = make_cache_dir_path (path, size, artist); size -= sz; path += sz; @@ -285,7 +286,7 @@ fetcher_thread (void *none) deadbeef->mutex_unlock (mutex); while (!terminate && queue && !clear_queue) { cover_query_t *param = queue; - char path [1024]; + char path [PATH_MAX]; struct dirent **files; int files_count; |