From 0060fed4517766bfe175efdc668769175da5ac74 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Wed, 16 Feb 2011 01:01:49 +0000 Subject: [PATCH] RaaA: Fix tagcache filename lookups for paths containing symbolic links git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29317 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagcache.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index ea7768139b..1babde2a02 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -430,7 +430,7 @@ static long find_entry_ram(const char *filename, } #endif -static long find_entry_disk(const char *filename, bool localfd) +static long find_entry_disk(const char *filename_raw, bool localfd) { struct tagcache_header tch; static long last_pos = -1; @@ -443,6 +443,13 @@ static long find_entry_disk(const char *filename, bool localfd) int i; int pos = -1; + char *filename = (char *)filename_raw; +#ifdef APPLICATION + char pathbuf[MAX_PATH]; + if (realpath(filename, pathbuf) == pathbuf) + filename = pathbuf; +#endif + if (!tc_stat.ready) return -2;