From 05a1984eb32dd07bcf5d54c147ace4d6f56a00b4 Mon Sep 17 00:00:00 2001 From: Michael Hohmuth Date: Wed, 1 Jun 2011 08:00:37 +0000 Subject: [PATCH] FS#12065 - Fix two regressions introduced with r26192 (FS#10976 / FS#10992 - make the string translatable): * The translation was done too early: before the tagnavi format clauses were checked. This prevented comparisons against "" when a non-English translation was active. * The code overwrote the buffer containing the constant string "" with the translation. This is neither safe nor necessary: The result pointer simply can be swapped with a pointer to the translation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29941 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagtree.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/tagtree.c b/apps/tagtree.c index d28928dbd5..a1c5640b74 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -1251,12 +1251,6 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) if (total_count++ < offset) continue; - if ( strcmp(tcs.result , UNTAGGED ) == 0) - { - tcs.result_len = strlcpy(tcs.result, - str(LANG_TAGNAVI_UNTAGGED), TAG_MAXLEN )+1; - } - dptr->newtable = NAVIBROWSE; if (tag == tag_title || tag == tag_filename) { @@ -1281,6 +1275,13 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) } } + if (strcmp(tcs.result, UNTAGGED) == 0) + { + tcs.result = str(LANG_TAGNAVI_UNTAGGED); + tcs.result_len = strlen(tcs.result); + tcs.ramresult = true; + } + if (!tcs.ramresult || fmt) { char buf[MAX_PATH];