From 5ca371c5c50c34b8431278991ff85218da3acbbc Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 29 Nov 2015 16:36:46 +0100 Subject: [PATCH] Displaying full track filename excluding the real extension --- src/ride/track.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ride/track.c b/src/ride/track.c index ff7bf11948..bb958325e0 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -3147,6 +3147,7 @@ void window_track_list_format_name(utf8 *dst, const utf8 *src, int colour, bool { const utf8 *ch; int codepoint; + char *lastDot = strrchr(src, '.'); if (colour != 0) { dst = utf8_write_codepoint(dst, colour); @@ -3155,8 +3156,8 @@ void window_track_list_format_name(utf8 *dst, const utf8 *src, int colour, bool if (quotes) dst = utf8_write_codepoint(dst, FORMAT_OPENQUOTES); ch = src; - while ((codepoint = utf8_get_next(ch, &ch)) != 0) { - if (codepoint == '.') break; + while (lastDot > ch) { + codepoint = utf8_get_next(ch, &ch); dst = utf8_write_codepoint(dst, codepoint); }