From: Max Kellermann Date: Sun, 11 Oct 2009 12:55:53 +0000 (+0200) Subject: screen_browser: don't return directory name with square brackets X-Git-Tag: release-0.16~116 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=25ddef443a86bf5c653ced291dbd071cc08f18c8;p=ncmpc.git screen_browser: don't return directory name with square brackets Since the browser_lw_callback() isn't used for rendering anymore (only for searching), we can remove the page breaks. --- diff --git a/src/list_window.c b/src/list_window.c index f8ab8e9..d1a6ce3 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -561,9 +561,6 @@ list_window_jump(struct list_window *lw, label = callback(i, &h, NULL, callback_data); assert(label != NULL); - if (label[0] == '[') - label++; - if (jump_match(label, str)) { list_window_move_cursor(lw, i); return true; diff --git a/src/screen_browser.c b/src/screen_browser.c index 16a2f5e..edcd2d9 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -96,15 +96,13 @@ browser_lw_callback(unsigned idx, bool *highlight, G_GNUC_UNUSED char **second_c #endif if( entity == NULL ) - return "[..]"; + return ".."; if (mpd_entity_get_type(entity) == MPD_ENTITY_TYPE_DIRECTORY) { const struct mpd_directory *dir = mpd_entity_get_directory(entity); char *directory = utf8_to_locale(g_basename(mpd_directory_get_path(dir))); - - g_snprintf(buf, BUFSIZE, "[%s]", directory); - g_free(directory); + g_strlcpy(buf, directory, sizeof(buf)); return buf; } else if (mpd_entity_get_type(entity) == MPD_ENTITY_TYPE_SONG) { const struct mpd_song *song = mpd_entity_get_song(entity);